@zeniai/client-epic-state 5.0.94 → 5.0.95-beta0ND

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 (80) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +1 -0
  3. package/lib/entity/company/companyPayload.d.ts +4 -0
  4. package/lib/entity/company/companyPayload.js +4 -0
  5. package/lib/entity/company/companyStateTypes.d.ts +4 -0
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.js +7 -0
  8. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
  9. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
  10. package/lib/entity/paymentAccount/paymentAccountSelector.js +4 -0
  11. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  12. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
  13. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
  14. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  15. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  16. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  17. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  18. package/lib/entity/tenant/tenantReducer.d.ts +38 -25
  19. package/lib/entity/tenant/tenantReducer.js +65 -5
  20. package/lib/entity/tenant/tenantState.d.ts +1 -0
  21. package/lib/epic.d.ts +6 -1
  22. package/lib/epic.js +7 -1
  23. package/lib/esm/commonStateTypes/animations.js +1 -0
  24. package/lib/esm/entity/company/companyPayload.js +4 -0
  25. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +7 -0
  26. package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +3 -0
  27. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
  28. package/lib/esm/entity/tenant/tenantReducer.js +63 -3
  29. package/lib/esm/epic.js +7 -1
  30. package/lib/esm/index.js +9 -6
  31. package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
  32. package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
  33. package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
  34. package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +42 -0
  35. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +29 -0
  36. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
  37. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +217 -50
  38. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +7 -1
  39. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +12 -0
  40. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +58 -0
  41. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +79 -0
  42. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
  43. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +260 -0
  44. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +105 -52
  45. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
  46. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +50 -0
  47. package/lib/index.d.ts +11 -7
  48. package/lib/index.js +54 -34
  49. package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
  50. package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
  51. package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
  52. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
  53. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +46 -0
  54. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +8 -0
  55. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +33 -0
  56. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +9 -0
  57. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +44 -0
  58. package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
  59. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +41 -4
  60. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +219 -51
  61. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +5 -1
  62. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +11 -2
  63. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +40 -0
  64. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -1
  65. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +28 -0
  66. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +62 -0
  67. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +9 -0
  68. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +83 -0
  69. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +33 -0
  70. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
  71. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +37 -0
  72. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +268 -0
  73. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
  74. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +106 -53
  75. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +7 -2
  76. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
  77. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +19 -0
  78. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +154 -0
  79. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +55 -0
  80. package/package.json +1 -1
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Pure mappers from ExtendAI parser payloads to our form-side local-data shapes.
3
+ *
4
+ * Each mapper filters out fields below KYC_KYB_AUTOFILL_MIN_CONFIDENCE and returns
5
+ * both the merged values and the list of field names that were autofilled so the
6
+ * UI can show the ✦ AI badge next to each.
7
+ */
8
+ import { date } from '../../../zeniDayJS';
9
+ import { toZeniUrl } from '../../../zeniUrl';
10
+ import { KYC_KYB_AUTOFILL_MIN_CONFIDENCE, } from './types/kycKybAutofill';
11
+ export const OFFICER_ADDRESS_AUTOFILL_FIELD = 'officerAddress';
12
+ // US driving licenses carry a US state in `address_state` but no country field;
13
+ // default the composed address to the US.
14
+ const DRIVING_LICENSE_DEFAULT_COUNTRY = 'United States';
15
+ const DRIVING_LICENSE_DEFAULT_COUNTRY_CODE = 'US';
16
+ const emptyResult = () => ({
17
+ values: {},
18
+ autoFilledFieldNames: [],
19
+ });
20
+ const isConfident = (field) => {
21
+ if (field == null) {
22
+ return false;
23
+ }
24
+ if (field.value == null) {
25
+ return false;
26
+ }
27
+ return field.confidence >= KYC_KYB_AUTOFILL_MIN_CONFIDENCE;
28
+ };
29
+ const assignAutofilledValue = (result, key, value) => {
30
+ if (value == null) {
31
+ return;
32
+ }
33
+ if (typeof value === 'string' && value.trim() === '') {
34
+ return;
35
+ }
36
+ result.values[key] = value;
37
+ result.autoFilledFieldNames.push(key);
38
+ };
39
+ const tryParseDate = (rawDate) => {
40
+ const parsedDate = date(rawDate);
41
+ if (parsedDate.isValid()) {
42
+ return parsedDate;
43
+ }
44
+ return undefined;
45
+ };
46
+ const NATIONALITY_SYNONYMS = {
47
+ usa: 'united states',
48
+ us: 'united states',
49
+ 'united states of america': 'united states',
50
+ america: 'united states',
51
+ american: 'united states',
52
+ uk: 'united kingdom',
53
+ gbr: 'united kingdom',
54
+ 'great britain': 'united kingdom',
55
+ british: 'united kingdom',
56
+ indian: 'india',
57
+ ind: 'india',
58
+ canadian: 'canada',
59
+ can: 'canada',
60
+ australian: 'australia',
61
+ aus: 'australia',
62
+ german: 'germany',
63
+ deu: 'germany',
64
+ french: 'france',
65
+ fra: 'france',
66
+ chinese: 'china',
67
+ chn: 'china',
68
+ japanese: 'japan',
69
+ jpn: 'japan',
70
+ mexican: 'mexico',
71
+ mex: 'mexico',
72
+ brazilian: 'brazil',
73
+ bra: 'brazil',
74
+ };
75
+ const normalizeNationality = (rawNationality, countries) => {
76
+ // Collapse whitespace + strip trailing punctuation so "U.S.A." and
77
+ // "UNITED STATES OF AMERICA " both resolve.
78
+ const needle = rawNationality
79
+ .trim()
80
+ .toLowerCase()
81
+ .replace(/\./g, '')
82
+ .replace(/\s+/g, ' ');
83
+ if (needle === '') {
84
+ return undefined;
85
+ }
86
+ // ISO-2 exact match (country list stores codes as ISO-2 — "US", "GB" ...).
87
+ const isoMatch = countries.find((country) => country.countryCode.toLowerCase() === needle);
88
+ if (isoMatch != null) {
89
+ return isoMatch.countryCode;
90
+ }
91
+ // Resolve synonyms (ISO-3, adjective, long-form name) to the canonical
92
+ // country-list `countryName`, then look that up.
93
+ const resolvedName = NATIONALITY_SYNONYMS[needle] ?? needle;
94
+ const nameMatch = countries.find((country) => country.countryName.toLowerCase() === resolvedName);
95
+ return nameMatch?.countryCode;
96
+ };
97
+ const splitFullName = (fullName) => {
98
+ const parts = fullName.trim().split(/\s+/);
99
+ if (parts.length === 1) {
100
+ return { firstName: parts[0], lastName: '' };
101
+ }
102
+ const lastName = parts[parts.length - 1];
103
+ const firstName = parts.slice(0, -1).join(' ');
104
+ return { firstName, lastName };
105
+ };
106
+ /** Passport → Company Officer. */
107
+ export const mapPassportToOfficer = (parsed, allNationalityCountries) => {
108
+ const result = emptyResult();
109
+ if (isConfident(parsed.first_name)) {
110
+ assignAutofilledValue(result, 'firstName', parsed.first_name.value);
111
+ }
112
+ if (isConfident(parsed.last_name)) {
113
+ assignAutofilledValue(result, 'lastName', parsed.last_name.value);
114
+ }
115
+ if (isConfident(parsed.date_of_birth)) {
116
+ const parsedDate = tryParseDate(parsed.date_of_birth.value);
117
+ if (parsedDate != null) {
118
+ assignAutofilledValue(result, 'birthday', parsedDate);
119
+ }
120
+ }
121
+ if (isConfident(parsed.nationality)) {
122
+ const isoCode = normalizeNationality(parsed.nationality.value, allNationalityCountries);
123
+ if (isoCode != null) {
124
+ assignAutofilledValue(result, 'nationalityCountryCode', isoCode);
125
+ }
126
+ }
127
+ return result;
128
+ };
129
+ /** Driving License → Company Officer (name, DOB, and home address). */
130
+ export const mapDrivingLicenseToOfficer = (parsed) => {
131
+ const result = emptyResult();
132
+ if (isConfident(parsed.first_name)) {
133
+ assignAutofilledValue(result, 'firstName', parsed.first_name.value);
134
+ }
135
+ if (isConfident(parsed.last_name)) {
136
+ assignAutofilledValue(result, 'lastName', parsed.last_name.value);
137
+ }
138
+ if (isConfident(parsed.date_of_birth)) {
139
+ const parsedDate = tryParseDate(parsed.date_of_birth.value);
140
+ if (parsedDate != null) {
141
+ assignAutofilledValue(result, 'birthday', parsedDate);
142
+ }
143
+ }
144
+ // The officer address lives in the addressView slice rather than
145
+ // CompanyOfficerLocalData, so it's returned separately for the epic to
146
+ // dispatch via newAddressInLocalStore.
147
+ const street = isConfident(parsed.address_street)
148
+ ? parsed.address_street.value.trim()
149
+ : undefined;
150
+ const city = isConfident(parsed.address_city)
151
+ ? parsed.address_city.value.trim()
152
+ : undefined;
153
+ const state = isConfident(parsed.address_state)
154
+ ? parsed.address_state.value.trim()
155
+ : undefined;
156
+ const postalCode = isConfident(parsed.address_zip)
157
+ ? parsed.address_zip.value.trim()
158
+ : undefined;
159
+ if (street != null ||
160
+ city != null ||
161
+ state != null ||
162
+ postalCode != null) {
163
+ result.address = {
164
+ street: street != null ? [street] : [],
165
+ city: city ?? '',
166
+ state: state ?? '',
167
+ postalCode: postalCode ?? '',
168
+ country: DRIVING_LICENSE_DEFAULT_COUNTRY,
169
+ countryCode: DRIVING_LICENSE_DEFAULT_COUNTRY_CODE,
170
+ };
171
+ result.autoFilledFieldNames.push(OFFICER_ADDRESS_AUTOFILL_FIELD);
172
+ }
173
+ return result;
174
+ };
175
+ /** SSN Card → Company Officer (name only — SSN value not yet returned by parser). */
176
+ export const mapSsnCardToOfficer = (parsed) => {
177
+ const result = emptyResult();
178
+ if (isConfident(parsed.full_name)) {
179
+ const { firstName, lastName } = splitFullName(parsed.full_name.value);
180
+ if (firstName !== '') {
181
+ assignAutofilledValue(result, 'firstName', firstName);
182
+ }
183
+ if (lastName !== '') {
184
+ assignAutofilledValue(result, 'lastName', lastName);
185
+ }
186
+ }
187
+ return result;
188
+ };
189
+ /** Certificate of Incorporation → Company Details. */
190
+ export const mapCoiToCompanyDetails = (parsed) => {
191
+ const result = emptyResult();
192
+ if (isConfident(parsed.company_legal_name)) {
193
+ assignAutofilledValue(result, 'companyLegalName', parsed.company_legal_name.value);
194
+ }
195
+ if (isConfident(parsed.ein)) {
196
+ assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
197
+ }
198
+ if (isConfident(parsed.phone_number)) {
199
+ assignAutofilledValue(result, 'phone', parsed.phone_number.value);
200
+ }
201
+ if (isConfident(parsed.product_description)) {
202
+ assignAutofilledValue(result, 'companyDescription', parsed.product_description.value);
203
+ }
204
+ if (isConfident(parsed.website)) {
205
+ try {
206
+ assignAutofilledValue(result, 'website', toZeniUrl(parsed.website.value));
207
+ }
208
+ catch {
209
+ // ignore — malformed URL string from OCR
210
+ }
211
+ }
212
+ if (isConfident(parsed.industry)) {
213
+ assignAutofilledValue(result, 'companyIndustryType', parsed.industry.value);
214
+ }
215
+ if (isConfident(parsed.sub_industry)) {
216
+ assignAutofilledValue(result, 'companySubIndustry', parsed.sub_industry.value);
217
+ }
218
+ if (isConfident(parsed.type_of_incorporation)) {
219
+ assignAutofilledValue(result, 'typeOfIncorporation', parsed.type_of_incorporation.value);
220
+ }
221
+ if (isConfident(parsed.date_of_incorporation)) {
222
+ const parsedDate = tryParseDate(parsed.date_of_incorporation.value);
223
+ if (parsedDate != null) {
224
+ assignAutofilledValue(result, 'incDate', parsedDate);
225
+ }
226
+ }
227
+ if (isConfident(parsed.state_of_incorporation)) {
228
+ assignAutofilledValue(result, 'stateOfIncorporation', parsed.state_of_incorporation.value);
229
+ }
230
+ if (isConfident(parsed.countries_of_operations)) {
231
+ assignAutofilledValue(result, 'countriesOfOperations', parsed.countries_of_operations.value);
232
+ }
233
+ if (isConfident(parsed.source_of_funds)) {
234
+ assignAutofilledValue(result, 'sourceOfFunds', parsed.source_of_funds.value);
235
+ }
236
+ if (isConfident(parsed.transaction_volume_expectations)) {
237
+ assignAutofilledValue(result, 'transactionVolume', parsed.transaction_volume_expectations.value);
238
+ }
239
+ if (isConfident(parsed.purpose_of_account)) {
240
+ assignAutofilledValue(result, 'purposeOfAccount', parsed.purpose_of_account.value);
241
+ }
242
+ if (isConfident(parsed.regulated_status)) {
243
+ assignAutofilledValue(result, 'regulatedStatus', parsed.regulated_status.value);
244
+ }
245
+ if (isConfident(parsed.us_nexus)) {
246
+ assignAutofilledValue(result, 'usNexus', parsed.us_nexus.value);
247
+ }
248
+ return result;
249
+ };
250
+ /** Tax EIN letter → Company Details. */
251
+ export const mapTaxEinToCompanyDetails = (parsed) => {
252
+ const result = emptyResult();
253
+ if (isConfident(parsed.legal_business_name)) {
254
+ assignAutofilledValue(result, 'companyLegalName', parsed.legal_business_name.value);
255
+ }
256
+ if (isConfident(parsed.ein)) {
257
+ assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
258
+ }
259
+ return result;
260
+ };
@@ -1,62 +1,30 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
+ import { parseUploadedKybDocument, parseUploadedKybDocumentFailure, parseUploadedKycDocument, parseUploadedKycDocumentFailure, } from './kycKybAutofillActions';
2
3
  const initialFetchStatus = {
3
4
  fetchState: 'Not-Started',
4
5
  error: undefined,
5
6
  };
7
+ const emptyOfficerSlot = {
8
+ autoFilledFields: [],
9
+ localData: undefined,
10
+ sendOtpStatus: initialFetchStatus,
11
+ otpverificationStatus: initialFetchStatus,
12
+ };
6
13
  export const initialState = {
7
14
  updateStatus: { fetchState: 'Not-Started', error: undefined },
8
- companyDetails: {},
15
+ parsingDocumentFileIds: [],
16
+ companyDetails: { autoFilledFields: [] },
9
17
  companyOfficerUpdateStatus: {
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
- },
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 },
60
28
  },
61
29
  primaryContactDetails: {},
62
30
  };
@@ -297,7 +265,92 @@ const setupView = createSlice({
297
265
  clearSetupView(draft) {
298
266
  Object.assign(draft, initialState);
299
267
  },
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
+ });
300
353
  },
301
354
  });
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;
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;
303
356
  export default setupView.reducer;
@@ -87,15 +87,17 @@ 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 } = getCompanyAndIdentityDetails(state, companyId, {
90
+ const { companyDetailsLocalData, companyOfficerLocalData, parsingDocumentFileIds } = getCompanyAndIdentityDetails(state, companyId, {
91
91
  companyDetails,
92
92
  companyOfficerUpdateStatus,
93
93
  primaryContactDetails,
94
+ parsingDocumentFileIds: setupViewState.parsingDocumentFileIds,
94
95
  });
95
96
  const allNationalityCountries = countryListState.byCountryListCode.nationalityCountryList.countries;
96
97
  return {
97
98
  companyDetailsLocalData,
98
99
  companyOfficerLocalData,
100
+ parsingDocumentFileIds,
99
101
  companyView,
100
102
  updateStatus,
101
103
  allNationalityCountries,
@@ -119,6 +121,7 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
119
121
  const companyAddress = addressViewState.newAddressState?.company_address;
120
122
  const registeredCompanyAddress = addressViewState.newAddressState?.company_registered_address;
121
123
  companyDetailsLocalData = {
124
+ autoFilledFields: companyDetails.autoFilledFields,
122
125
  companyId,
123
126
  companyDescription,
124
127
  companyLegalName,
@@ -191,6 +194,7 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
191
194
  const companyOfficerAddress = addressViewState.newAddressState?.[addressType];
192
195
  companyOfficerLocalData[officerType] = {
193
196
  ...companyOfficer.localData,
197
+ autoFilledFields: companyOfficer.autoFilledFields,
194
198
  userFiles: getFilesByFileIds(fileState, fileIds),
195
199
  additionalFiles: getFilesByFileIds(fileState, additionalSubmittedDocumentsForVerificationFileIds),
196
200
  deleteFileStatusById,
@@ -204,6 +208,7 @@ export const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentit
204
208
  return {
205
209
  companyDetailsLocalData,
206
210
  companyOfficerLocalData,
211
+ parsingDocumentFileIds: companyAndIdentityDetails.parsingDocumentFileIds,
207
212
  };
208
213
  };
209
214
  /* This helper function takes deposit accounts and payment accounts
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Shared types for the KYC / KYB document autofill flow that lives inside the
3
+ * commonSetup feature (Setup pages + Onboarding both consume it via the same
4
+ * selector view; there is no separate state slice).
5
+ *
6
+ * Backed by document-communication-agent `POST /1.0/documents/process/sync`,
7
+ * which proxies document-service ExtendAI parsers and returns one of the
8
+ * parser payloads below — each value shaped as `{value, confidence}` per field.
9
+ */
10
+ /** Confidence floor below which we drop an autofill candidate. */
11
+ export const KYC_KYB_AUTOFILL_MIN_CONFIDENCE = 0.5;
12
+ /**
13
+ * Maps the form-side {@link KycSelectDocumentType} (camelCase) to the
14
+ * parser-side {@link KycProvidedDocumentType} (snake_case). Returns `null` for
15
+ * `stateId`, which has no parser today.
16
+ */
17
+ export const toKycProvidedDocumentType = (selectType) => {
18
+ switch (selectType) {
19
+ case 'driverLicense':
20
+ return 'driving_license';
21
+ case 'passport':
22
+ return 'passport';
23
+ case 'ssnCard':
24
+ return 'social_security_card';
25
+ case 'stateId':
26
+ return null;
27
+ }
28
+ };
29
+ /**
30
+ * Maps a persisted {@link AllowedDocumentType} (snake_case — the value stored on
31
+ * an officer's `documentTypeSelectedForVerification`) to the parser-side
32
+ * {@link KycProvidedDocumentType}. Returns `null` for document types with no KYC
33
+ * parser today (e.g. `id_document` / state ID, and any non-identity doc).
34
+ *
35
+ * The officer's stored selection is an `AllowedDocumentType`, not a
36
+ * {@link KycSelectDocumentType}; use this — not {@link toKycProvidedDocumentType}
37
+ * — when triggering autofill off that field.
38
+ */
39
+ export const toKycProvidedDocumentTypeFromAllowed = (allowedType) => {
40
+ switch (allowedType) {
41
+ case 'passport':
42
+ return 'passport';
43
+ case 'driving_license':
44
+ return 'driving_license';
45
+ case 'social_security_card':
46
+ return 'social_security_card';
47
+ default:
48
+ return null;
49
+ }
50
+ };
package/lib/index.d.ts CHANGED
@@ -103,6 +103,7 @@ import { updateCommentsNotifications, updateCommentsNotificationsStatuses } from
103
103
  import { NotificationWithAuthors } from './entity/notification/types/notificationSelectorTypes';
104
104
  import { Notification, NotificationActivity, NotificationEventData, NotificationMetaData, NotificationUpdates, NotificationValueFormat } from './entity/notification/types/notificationStateTypes';
105
105
  import { ExternalNotificationData, NotificationActivityType, NotificationGroup, NotificationIdentifierType, NotificationMode, NotificationStatus, NotificationUpdateValue, toNotificationModeStrict } from './entity/notification/types/notificationTypes';
106
+ import { getPlaidPaymentAccounts } from './entity/paymentAccount/paymentAccountSelector';
106
107
  import { Logo, PaymentAccount, VERIFIED_PAYMENT_ACCOUNT_PROVIDER_VERIFICATION_STATUS } from './entity/paymentAccount/paymentAccountState';
107
108
  import { PaymentInstrument } from './entity/paymentInstrument/paymentInstrument';
108
109
  import { AccountingSummary, Runway } from './entity/portfolio/accountingSummary/accountingSummaryState';
@@ -129,7 +130,7 @@ import { TaskPayload } from './entity/task/taskPayload';
129
130
  import { getTaskGroupById } from './entity/taskGroup/taskGroupSelector';
130
131
  import { TaskGroupState } from './entity/taskGroup/taskGroupState';
131
132
  import { TaskGroupTemplate } from './entity/taskGroupTemplate/taskGroupTemplateState';
132
- import { DoSignInPayload, clearAll, deleteConnection, doMagicLinkSignIn, doSignIn, doSignOut, fetchActiveTenant, fetchAllTenants, fetchExcludedResources as fetchExcludedResourcesForTenant, fetchExternalConnections as fetchExternalConnectionsForTenant, fetchSubscriptionSummaryForTenant, resendVerifyDeviceOTP, resetSignInState, saveAPIKeyConnection, saveConnectorCredentials, saveExternalConnection as saveExternalConnectionForTenant, saveOAuthConnection, sendEmailMagicLinkToUser, sendSessionHeartbeat, toExternalIntegrationType, toExternalSupportedTool, updateCurrentTenant, updateSignInState, verifyDeviceWithTwoFA } from './entity/tenant/tenantReducer';
133
+ import { DoSignInPayload, clearAll, deleteConnection, doMagicLinkSignIn, doSignIn, doSignOut, fetchActiveTenant, fetchAllTenants, fetchExcludedResources as fetchExcludedResourcesForTenant, fetchExternalConnections as fetchExternalConnectionsForTenant, fetchSubscriptionSummaryForTenant, initEmailConnectOAuth, resendVerifyDeviceOTP, resetSignInState, saveAPIKeyConnection, saveConnectorCredentials, saveExternalConnection as saveExternalConnectionForTenant, saveOAuthConnection, sendEmailMagicLinkToUser, sendSessionHeartbeat, toExternalIntegrationType, toExternalSupportedTool, updateCurrentTenant, updateSignInState, verifyDeviceWithTwoFA } from './entity/tenant/tenantReducer';
133
134
  import { CurrentTenant, TenantBaseView, TenantCoreDetailsView, TenantView, TenantsBaseOrdered, TenantsOrdered, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantBaseById, getTenantBaseViewForTenantId, getTenantBaseViewForTenantView, getTenantsBaseByCheckInDateSelector, getTenantsByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, isOtherProductsEnabledForTenant, isTenantBankingOnly, isTenantBookkeepingEnabled, isTenantCardsOnly, isTenantUsingZeniCOA, isZeniDomainTenant, toTenantCoreDetailsView } from './entity/tenant/tenantSelector';
134
135
  import { CapitalizableAccount, CapitalizableAccounts, CapitalizableClassificationType, CapitalizableMatchPattern, Connection, LoggedInUser, RoleResource, Tenant, TenantProductSettings } from './entity/tenant/tenantState';
135
136
  import { ToastNotificationPayload } from './entity/toastNotification/toastNotificationPayload';
@@ -338,9 +339,9 @@ import { clearOnboardingCustomerViewUpdateData, fetchCompanyOnboardingView, fetc
338
339
  import { NewOnboardingCustomerLocalData, NewOnboardingCustomerView, OnboardingCockpitView, ProductInfo, getNewOnboardingCustomerView, getOnboardingCockpitView } from './view/onboardingView/cockpitView/onboardingCockpitViewSelector';
339
340
  import { OnboardingCustomerListUIState, QBOConnectionPool } from './view/onboardingView/cockpitView/onboardingCockpitViewState';
340
341
  import { CustomerCreationStatus, NewOnboardingCustomer, OnboardingCompanyDetails, OnboardingCustomer, OnboardingCustomerCompletedStatus, ProductGroupType, ProductType, toProductType, toProductTypeStrict } from './view/onboardingView/cockpitView/types/onboardingCockpitViewTypes';
341
- import { clearOnboardingCustomerView, clearOnboardingCustomerViewDataInLocalStore, establishOnboardingPlaidConnection, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerView, getOnboardingPlaidLinkToken, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, updateCurrentStep, updateOnboardingCustomerView, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewLocalStoreData, updateOnboardingCustomerViewUIState, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus } from './view/onboardingView/customerView/onboardingCustomerViewReducer';
342
+ import { acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, applyKybDocumentAutofillForOnboarding, applyKycDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, clearOnboardingCustomerView, clearOnboardingCustomerViewDataInLocalStore, establishOnboardingPlaidConnection, fetchAiAgentsActivationStatus, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerView, getOnboardingPlaidLinkToken, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, updateCurrentStep, updateOnboardingCustomerView, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewLocalStoreData, updateOnboardingCustomerViewUIState, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus } from './view/onboardingView/customerView/onboardingCustomerViewReducer';
342
343
  import { OnboardingCustomerView, getOnboardingCustomerView, getProductSettingsString } from './view/onboardingView/customerView/onboardingCustomerViewSelector';
343
- import { OnboardingCustomerViewLocalData, OnboardingCustomerViewUIState, OnboardingStep } from './view/onboardingView/customerView/onboardingCustomerViewState';
344
+ import { AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, OnboardingCustomerViewLocalData, OnboardingCustomerViewUIState, OnboardingStep } from './view/onboardingView/customerView/onboardingCustomerViewState';
344
345
  import { fetchOpEx, fetchOpExWithForecast, updateOpExCOABalancesRange, updateOpExDownloadState, updateOpExUIState } from './view/opEx/opExReducer';
345
346
  import { getOperatingExpensesForHighlightedRange, getOperatingExpensesForSelectedRange, getOperatingExpensesReport, getOperatingExpensesReportFetchState, getOperatingExpensesUIState } from './view/opEx/opExSelector';
346
347
  import { OpExReport, OpExUIStateSelectorView } from './view/opEx/opExSelectorTypes';
@@ -484,7 +485,8 @@ import { ActiveChargeCardCount, ActiveDebitCardCount, ActiveDebitCardCountByUser
484
485
  import { toIssueChargeCardLocalDataFromDraft } from './view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft';
485
486
  import { CommonHistoryView, HistoricEvent, HistoricEventUpdate } from './view/spendManagement/commonHistoryView/commonHistory';
486
487
  import { ActivityHistorySelectorView } from './view/spendManagement/commonHistoryView/commonHistorySelector';
487
- import { clearSetupViewDataInLocalStore, enableSetup, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData } from './view/spendManagement/commonSetup/setupViewReducer';
488
+ import { parseUploadedKybDocument, parseUploadedKycDocument } from './view/spendManagement/commonSetup/kycKybAutofillActions';
489
+ import { applyKybDocumentAutofillForSetup, applyKycDocumentAutofillForSetup, clearKycKybAutofillForSetup, clearSetupViewDataInLocalStore, enableSetup, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveIndustryAndIncDateInLocalStore, saveSetupViewDataInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, updateBusinessVerificationDetails, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData } from './view/spendManagement/commonSetup/setupViewReducer';
488
490
  import { BusinessVerificationDetails, CompanyDetails, CompanyOfficersDetails, FundingAccount, SetupView, getBusinessVerificationDetails, getCommonSetupViewDetails } from './view/spendManagement/commonSetup/setupViewSelector';
489
491
  import { SetupViewLocalData, SetupViewState } from './view/spendManagement/commonSetup/setupViewState';
490
492
  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';
@@ -678,7 +680,7 @@ export { TimeframeTick, TimeframeTickWithMetaData, toTimeframeTick, mapTimePerio
678
680
  export { VendorSpendTrendFilterTabType, toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
679
681
  export { getNumberOfPeriods };
680
682
  export { SCHEDULE_DAYS_OF_MONTH, ScheduleDaysOfMonth, toScheduleDaysOfMonth, Day, Month, toMonth, toMonthStrict, Quarter, toQuarter, toQuarterStrict, AbsoluteDay, TimePeriod, };
681
- export { CapitalizableAccount, CapitalizableAccounts, CapitalizableClassificationType, CapitalizableMatchPattern, Tenant, TenantView, LoggedInUser, TenantBaseView, CurrentTenant, TenantProductSettings, getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, TenantsBaseOrdered, TenantsOrdered, TenantCoreDetailsView, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, DoSignInPayload, doSignOut, sendSessionHeartbeat, resetSignInState, RoleResource, Connection, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, deleteConnection, saveAPIKeyConnection, saveConnectorCredentials, saveOAuthConnection, toExternalIntegrationType, toExternalSupportedTool, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
683
+ export { CapitalizableAccount, CapitalizableAccounts, CapitalizableClassificationType, CapitalizableMatchPattern, Tenant, TenantView, LoggedInUser, TenantBaseView, CurrentTenant, TenantProductSettings, getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, TenantsBaseOrdered, TenantsOrdered, TenantCoreDetailsView, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, DoSignInPayload, doSignOut, sendSessionHeartbeat, resetSignInState, RoleResource, Connection, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, deleteConnection, saveAPIKeyConnection, saveConnectorCredentials, saveOAuthConnection, initEmailConnectOAuth, toExternalIntegrationType, toExternalSupportedTool, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
682
684
  export { Account, AccountType, AccountBase, StatementCloseDay, toAccountType, AccountReport, NestedAccountReport, AccountWithBalanceReport, AccountGroup, AccountGroupReportV2, AccountGroupType, toAccountGroupType, AccountGroupReport, getAccountGroupKey, AccountGroupKey, RecommendedAccountBase, AccountFilterOption, getAllAccounts, getTransactionFilterAccountOptions, };
683
685
  export { Class, ClassBase, RecommendedClassBase, } from './entity/class/classState';
684
686
  export { ClassFilterOption, getAllClasses, getClassById, getClassFilterOptions, } from './entity/class/classSelector';
@@ -808,7 +810,7 @@ export { AccountListSelectorView, ClassListSelectorView, getClassList, fetchClas
808
810
  export { BillTab, BillsSubTabType, SaveBillStageCode, BillPayReviewSelectorView, DuplicateBillsSelectorView, EditBillDetailSelectorView, LineItemRecommendationsLocalData, EditBillInitialDetails, BillableStatus, PaymentDetailsSection, BillListReport, BillListDownloadReport, WhatForSection, fetchBillList, fetchBillListPerTab, updateTab, updateSubTab, updateSelectedBillId, updateBillDetailSaveBillCode, fetchVendorByNameAndParseInvoice, saveBillUpdatesToLocalStore, discardBillUpdatesInLocalStore, saveBillDetail, approveOrRejectBill, updateApprovalStatusOnSuccess, deleteBill, cancelAndDeleteBill, retryOrRefundBill, getBillList, getBillDownloadList, BillDetailViewSelector, ActorActivityWithUser, BillActivity, StepWithStatus, getBillDetailView, checkApproveRejectBtnShowForBill, BillDetailView, getBillTransactionDetailKey, fetchBillDetail, fetchEditBillDetailPage, fetchAndUpdateVendorRecommendations, fetchDuplicateBill, clearBillPayReview, EditBillDetail, EditBillDetailViewState, getEditBillDetail, getReviewPageBillDetail, BillDetailLocalData, PaymentDetailsSectionView, fetchBillAndInitializeLocalStore, updateShowAutofill, saveVendorSuccessOrFailure, BillPaymentStatus, BillPaymentStatusCodeType, BillPaymentRefundStatus, BillPaymentRefundStatusCodeType, BillStatus, BillStatusCodeType, BillApprovalType, updateBillListUIState, BillListUIState, BillPayViewSortKey, BillPayFilters, BillPayFilterCategory, BillListViewFilterCategoryField, BILL_PAY_FILTER_CATEGORIES, updateVendorDetailLocalData, resetVendorDetailLocalData, resetVendorSaveStatus, updateContactsInVendorDetailLocalData, updateVendorTabDetailUIState, updateContactsInVendorTabDetailLocalData, updateBillUploadFetchState, updateBillListSearchResult, fetchUserDetails, verifyUser, updateVendorContact, PaymentToOption, toPaymentToOption, convertAmountToHomeCurrency, RecurringBillInstance, RecurringBillConfigLocalData, EditRecurringBillType, fetchVendorAndUpdateBillLocalData, markBillForRetry, updateWithdrawFromAccountId, removeBillFileFromLocalStore, replaceBillFileInLocalStore, updateShouldReplaceBillData, };
809
811
  export { SpendManagementFiltersType, SpendManagementFilterEntityType, FilterCategoryType, BillPayFilterCategoryDropdownOption, ReimbursementFilterCategoryDropdownOption, TaskFilterCategoryDropdownOption, SpendManagementFilterCategoryDropdownOption, MatchingOperatorDropdownOption, CategoryCombinationOperator, hideCreatedByFilter, };
810
812
  export { TRANSACTION_FILTER_CATEGORIES, TransactionFilterAmountMatchingOperator, TransactionFilterCategory, TransactionFilterCategoryDropdownOption, TransactionFilterCategoryField, TransactionFilterEntityType, TransactionFilters, applyTransactionFilters, };
811
- export { BillPaySetupViewState, ZeniAccountSetupViewState, BillPaySetupViewLocalData, ZeniAccountSetupViewLocalData, PlaidAccountState, fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearBillPaySetupView, clearZeniAccountSetupView, sendOtp, resendOtp, verifyOtp, CompanyDetails, CompanyOfficersDetails, BillPaySetupView, ZeniAccountSetupView, BillPayBusinessVerificationDetails, ZeniAccountBusinessVerificationDetails, TreasuryBusinessVerificationDetails, SetupViewState, SetupViewLocalData, SetupView, BusinessVerificationDetails, getBillPaySetupViewDetails, getPlaidAccountDetails, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, PlaidConnectionDetails, PlaidLinkTokenType, PlaidAccountKeyType, Token, FundingAccount, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, TwoFactorAuthenticationView, };
813
+ export { BillPaySetupViewState, ZeniAccountSetupViewState, BillPaySetupViewLocalData, ZeniAccountSetupViewLocalData, PlaidAccountState, fetchBillPaySetupView, fetchZeniAccountSetupView, enableSetup, getPaymentAccounts, getPlaidLinkToken, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, updateBusinessVerificationDetails, updatePaymentAccount, updatePaymentAccountLoginStatus, updatePaymentAccountStatus, establishPlaidConnection, updateMappedCashAccount, updatePrimaryFundingAccount, acceptBillPayTerms, acceptZeniAccountTerms, acceptBillPayUpdatedTerms, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearBillPaySetupView, clearZeniAccountSetupView, applyKycDocumentAutofillForSetup, applyKybDocumentAutofillForSetup, clearKycKybAutofillForSetup, parseUploadedKycDocument, parseUploadedKybDocument, sendOtp, resendOtp, verifyOtp, CompanyDetails, CompanyOfficersDetails, BillPaySetupView, ZeniAccountSetupView, BillPayBusinessVerificationDetails, ZeniAccountBusinessVerificationDetails, TreasuryBusinessVerificationDetails, SetupViewState, SetupViewLocalData, SetupView, BusinessVerificationDetails, getBillPaySetupViewDetails, getPlaidAccountDetails, getPlaidPaymentAccounts, getZeniAccountSetupViewDetails, getBusinessVerificationDetails, getBillPayBusinessVerificationDetails, getZeniAccountBusinessVerificationDetails, getTreasuryBusinessVerificationDetails, getCommonSetupViewDetails, PlaidConnectionDetails, PlaidLinkTokenType, PlaidAccountKeyType, Token, FundingAccount, getTwoFactorAuthenticationView, getTwoFactorAuthenticationViewForCardUserOnboarding, getTwoFactorAuthenticationViewForChargeCardHolder, TwoFactorAuthenticationView, };
812
814
  export { BankConnectionsSetupView, IntegrationsView, getApprovalRuleViewDetails, getBankConnectionsSetupViewDetails, getIntegrationsView, };
813
815
  export { fetchUserFinancialAccount };
814
816
  export { getUserFinancialAccount, UserFinancialAccountSelectorView };
@@ -862,7 +864,7 @@ export { CountryWithCurrency };
862
864
  export { fetchCompanyConfig };
863
865
  export { getCompanyConfig };
864
866
  export { isZeniClearingAccountReport, ZENI_CLEARING_ACCOUNT, isZeniClearingAccount, };
865
- export { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, getOnboardingPlaidLinkToken, establishOnboardingPlaidConnection, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus, updateOnboardingCustomerView, updateOnboardingCustomerViewLocalStoreData, updateCurrentStep, updateOnboardingCustomerViewUIState, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, clearOnboardingCustomerViewDataInLocalStore, getOnboardingCustomerView, getProductSettingsString, OnboardingCustomerView, OnboardingStep, OnboardingCustomerViewUIState, OnboardingCustomerViewLocalData, };
867
+ export { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, getOnboardingPlaidLinkToken, establishOnboardingPlaidConnection, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountStatus, updateOnboardingCustomerView, updateOnboardingCustomerViewLocalStoreData, updateCurrentStep, updateOnboardingCustomerViewUIState, saveOnboardingCompnayOfficerPhoneInLocalStore, saveOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, clearOnboardingCustomerViewDataInLocalStore, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiFinanceTeam, fetchAiAgentsActivationStatus, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, getOnboardingCustomerView, getProductSettingsString, OnboardingCustomerView, OnboardingStep, OnboardingCustomerViewUIState, OnboardingCustomerViewLocalData, AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationPhaseStatus, AiAgentsActivationSubview, };
866
868
  export { saveAccountMapping, saveAccountMappingLocalData, clearAccountMappingLocalData, AccountMappingLocalData, AccountMappingView, VendorAccountMappingView, getAccountMappingView, initializeAccountMappingView, ExpenseCategory1099Filing, };
867
869
  export { MagicLinkView, getMagicLinkView, getMagicLinkBankAccountView, getMagicLinkCurrentAddressState, };
868
870
  export { fetchMagicLinkTenant, fetchBillAttachment, saveBankAccount, updateMagicLinkBankAccountLocalStoreData, updateMagicLinkInternationalBankAccountLocalStoreData, fetchMagicLinkBankNameByRouting, fetchMagicLinkBankNameBySwift, saveMagicLinkAddressInLocalStore, };
@@ -975,3 +977,5 @@ export { UserGroup } from './entity/userGroups/userGroupsState';
975
977
  export { SessionManager } from './entity/tenant/SessionManager';
976
978
  export type { SessionCallbacks, SessionConfig, } from './entity/tenant/sessionTypes';
977
979
  export { DEFAULT_SESSION_CONFIG } from './entity/tenant/sessionTypes';
980
+ export type { KybProvidedDocumentType, KycKybAutofillTarget, KycKybProvidedDocumentType, KycProvidedDocumentType, KycSelectDocumentType, } from './view/spendManagement/commonSetup/types/kycKybAutofill';
981
+ export { toKycProvidedDocumentType, toKycProvidedDocumentTypeFromAllowed, } from './view/spendManagement/commonSetup/types/kycKybAutofill';