@zeniai/client-epic-state 5.0.92-beta0ND → 5.0.92-betaNB2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +0 -1
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +20 -1
- package/lib/entity/accountRecon/accountReconPayload.js +23 -1
- package/lib/entity/accountRecon/accountReconSelector.d.ts +6 -1
- package/lib/entity/accountRecon/accountReconSelector.js +5 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +19 -0
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -4
- package/lib/entity/company/companyStateTypes.d.ts +0 -4
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +7 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +9 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +7 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -4
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +3 -6
- package/lib/epic.js +3 -7
- package/lib/esm/commonStateTypes/animations.js +0 -1
- package/lib/esm/entity/accountRecon/accountReconPayload.js +23 -1
- package/lib/esm/entity/accountRecon/accountReconSelector.js +5 -0
- package/lib/esm/entity/company/companyPayload.js +0 -4
- package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +9 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -3
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/epic.js +3 -7
- package/lib/esm/index.js +8 -11
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +34 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +42 -0
- package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +73 -0
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +98 -4
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +20 -0
- package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +20 -0
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +50 -217
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -7
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +0 -12
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -105
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/index.d.ts +12 -16
- package/lib/index.js +37 -49
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +38 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.d.ts +19 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +46 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +83 -1
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +75 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +35 -3
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +99 -5
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +5 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +20 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +128 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +21 -0
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +4 -41
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -219
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +2 -11
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -40
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +1 -13
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -106
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -54
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -50
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -42
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -52
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -59
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -205
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -28
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -46
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -56
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -30
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -63
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -33
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -213
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -125
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -32
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.acknowledgeOnboardingAiFinanceTeamEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
-
const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
|
|
10
|
-
const acknowledgeOnboardingAiFinanceTeamEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeam.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { companyId } = action.payload;
|
|
12
|
-
const payload = {
|
|
13
|
-
is_onboarding_ai_finance_team_acknowledged: true,
|
|
14
|
-
};
|
|
15
|
-
return zeniAPI
|
|
16
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
17
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
|
-
const actions = [
|
|
20
|
-
(0, companyReducer_1.updateCompanies)({
|
|
21
|
-
payload: response.data.companies,
|
|
22
|
-
schema: {},
|
|
23
|
-
}),
|
|
24
|
-
(0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamSuccess)(),
|
|
25
|
-
];
|
|
26
|
-
return (0, rxjs_1.from)(actions);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
30
|
-
messageSection: 'onboarding_customer_view_complete',
|
|
31
|
-
messageText: 'failed',
|
|
32
|
-
type: 'error',
|
|
33
|
-
variables: [
|
|
34
|
-
{
|
|
35
|
-
variableName: '_api-error_',
|
|
36
|
-
variableValue: response.status.message,
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
}), (0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamFailure)(response.status));
|
|
40
|
-
}
|
|
41
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Acknowledge - Onboarding AI Finance Team errored out' +
|
|
42
|
-
JSON.stringify(error))))));
|
|
43
|
-
}));
|
|
44
|
-
exports.acknowledgeOnboardingAiFinanceTeamEpic = acknowledgeOnboardingAiFinanceTeamEpic;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
-
import { applyKybDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
5
|
-
import { parseUploadedKybDocument, parseUploadedKybDocumentFailure } from '../../kycKybAutofillActions';
|
|
6
|
-
import { applyKybDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
7
|
-
import { CompanyDetailsLocalData } from '../../setupViewState';
|
|
8
|
-
export type ActionType = ReturnType<typeof parseUploadedKybDocument | typeof parseUploadedKybDocumentFailure | typeof applyKybDocumentAutofillForSetup | typeof applyKybDocumentAutofillForOnboarding>;
|
|
9
|
-
export declare const parseUploadedKybDocumentEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
10
|
-
payload: import("../../kycKybAutofillActions").ParseUploadedDocumentFailurePayload;
|
|
11
|
-
type: string;
|
|
12
|
-
} | {
|
|
13
|
-
payload: {
|
|
14
|
-
autoFilledFieldNames: string[];
|
|
15
|
-
companyId: import("../../../../..").ID;
|
|
16
|
-
fileId: import("../../../../..").ID;
|
|
17
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
18
|
-
};
|
|
19
|
-
type: "onboardingCustomerView/applyKybDocumentAutofillForOnboarding";
|
|
20
|
-
} | {
|
|
21
|
-
payload: {
|
|
22
|
-
autoFilledFieldNames: string[];
|
|
23
|
-
companyId: import("../../../../..").ID;
|
|
24
|
-
fileId: import("../../../../..").ID;
|
|
25
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
26
|
-
};
|
|
27
|
-
type: "setupView/applyKybDocumentAutofillForSetup";
|
|
28
|
-
}>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseUploadedKybDocumentEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const onboardingCustomerViewReducer_1 = require("../../../../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
8
|
-
const kycKybAutofillActions_1 = require("../../kycKybAutofillActions");
|
|
9
|
-
const kycKybParseMapper_1 = require("../../kycKybParseMapper");
|
|
10
|
-
const setupViewReducer_1 = require("../../setupViewReducer");
|
|
11
|
-
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
12
|
-
const parseUploadedKybDocumentEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(kycKybAutofillActions_1.parseUploadedKybDocument.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { target, companyId, fileId, documentType } = action.payload;
|
|
14
|
-
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
15
|
-
const requestPayload = {
|
|
16
|
-
provided_document_type: documentType,
|
|
17
|
-
files: [{ file_id: fileId }],
|
|
18
|
-
processing_priority: 10,
|
|
19
|
-
metadata: { source: 'kyc_kyb_autofill' },
|
|
20
|
-
};
|
|
21
|
-
const failureAction = (0, kycKybAutofillActions_1.parseUploadedKybDocumentFailure)({ target, fileId });
|
|
22
|
-
return zeniAPI
|
|
23
|
-
.postAndGetJSON(url, requestPayload)
|
|
24
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
-
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
26
|
-
return (0, rxjs_1.of)(failureAction);
|
|
27
|
-
}
|
|
28
|
-
let result;
|
|
29
|
-
switch (documentType) {
|
|
30
|
-
case 'certificate_of_incorporation':
|
|
31
|
-
result = (0, kycKybParseMapper_1.mapCoiToCompanyDetails)(response.data);
|
|
32
|
-
break;
|
|
33
|
-
case 'tax_ein':
|
|
34
|
-
result = (0, kycKybParseMapper_1.mapTaxEinToCompanyDetails)(response.data);
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
38
|
-
return (0, rxjs_1.of)(failureAction);
|
|
39
|
-
}
|
|
40
|
-
const applyAction = target === 'setup'
|
|
41
|
-
? (0, setupViewReducer_1.applyKybDocumentAutofillForSetup)({
|
|
42
|
-
companyId,
|
|
43
|
-
fileId,
|
|
44
|
-
values: result.values,
|
|
45
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
46
|
-
})
|
|
47
|
-
: (0, onboardingCustomerViewReducer_1.applyKybDocumentAutofillForOnboarding)({
|
|
48
|
-
companyId,
|
|
49
|
-
fileId,
|
|
50
|
-
values: result.values,
|
|
51
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
52
|
-
});
|
|
53
|
-
return (0, rxjs_1.of)(applyAction);
|
|
54
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)(failureAction)));
|
|
55
|
-
}));
|
|
56
|
-
exports.parseUploadedKybDocumentEpic = parseUploadedKybDocumentEpic;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
-
import { applyKycDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
5
|
-
import { parseUploadedKycDocument, parseUploadedKycDocumentFailure } from '../../kycKybAutofillActions';
|
|
6
|
-
import { applyKycDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
7
|
-
import { CompanyOfficerLocalData } from '../../setupViewState';
|
|
8
|
-
export type ActionType = ReturnType<typeof parseUploadedKycDocument | typeof parseUploadedKycDocumentFailure | typeof applyKycDocumentAutofillForSetup | typeof applyKycDocumentAutofillForOnboarding>;
|
|
9
|
-
export declare const parseUploadedKycDocumentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
10
|
-
payload: import("../../kycKybAutofillActions").ParseUploadedDocumentFailurePayload;
|
|
11
|
-
type: string;
|
|
12
|
-
} | {
|
|
13
|
-
payload: {
|
|
14
|
-
autoFilledFieldNames: string[];
|
|
15
|
-
companyId: import("../../../../..").ID;
|
|
16
|
-
fileId: import("../../../../..").ID;
|
|
17
|
-
officerType: import("../../../../..").CompanyOfficerType;
|
|
18
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
19
|
-
};
|
|
20
|
-
type: "onboardingCustomerView/applyKycDocumentAutofillForOnboarding";
|
|
21
|
-
} | {
|
|
22
|
-
payload: {
|
|
23
|
-
autoFilledFieldNames: string[];
|
|
24
|
-
companyId: import("../../../../..").ID;
|
|
25
|
-
fileId: import("../../../../..").ID;
|
|
26
|
-
officerType: import("../../../../..").CompanyOfficerType;
|
|
27
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
28
|
-
};
|
|
29
|
-
type: "setupView/applyKycDocumentAutofillForSetup";
|
|
30
|
-
}>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseUploadedKycDocumentEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const countryListSelector_1 = require("../../../../../entity/countryList/countryListSelector");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const onboardingCustomerViewReducer_1 = require("../../../../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
9
|
-
const kycKybAutofillActions_1 = require("../../kycKybAutofillActions");
|
|
10
|
-
const kycKybParseMapper_1 = require("../../kycKybParseMapper");
|
|
11
|
-
const setupViewReducer_1 = require("../../setupViewReducer");
|
|
12
|
-
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
13
|
-
const parseUploadedKycDocumentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(kycKybAutofillActions_1.parseUploadedKycDocument.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
-
const { target, companyId, officerType, fileId, documentType } = action.payload;
|
|
15
|
-
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
16
|
-
const requestPayload = {
|
|
17
|
-
provided_document_type: documentType,
|
|
18
|
-
files: [{ file_id: fileId }],
|
|
19
|
-
processing_priority: 10,
|
|
20
|
-
metadata: { source: 'kyc_kyb_autofill' },
|
|
21
|
-
};
|
|
22
|
-
const failureAction = (0, kycKybAutofillActions_1.parseUploadedKycDocumentFailure)({ target, fileId });
|
|
23
|
-
return zeniAPI
|
|
24
|
-
.postAndGetJSON(url, requestPayload)
|
|
25
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
26
|
-
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
27
|
-
return (0, rxjs_1.of)(failureAction);
|
|
28
|
-
}
|
|
29
|
-
const allCountries = (0, countryListSelector_1.getCountryList)(state$.value.countryListState, 'nationalityCountryList').countries;
|
|
30
|
-
let result;
|
|
31
|
-
switch (documentType) {
|
|
32
|
-
case 'passport':
|
|
33
|
-
result = (0, kycKybParseMapper_1.mapPassportToOfficer)(response.data, allCountries);
|
|
34
|
-
break;
|
|
35
|
-
case 'driving_license':
|
|
36
|
-
result = (0, kycKybParseMapper_1.mapDrivingLicenseToOfficer)(response.data);
|
|
37
|
-
break;
|
|
38
|
-
case 'social_security_card':
|
|
39
|
-
result = (0, kycKybParseMapper_1.mapSsnCardToOfficer)(response.data);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
43
|
-
return (0, rxjs_1.of)(failureAction);
|
|
44
|
-
}
|
|
45
|
-
const applyAction = target === 'setup'
|
|
46
|
-
? (0, setupViewReducer_1.applyKycDocumentAutofillForSetup)({
|
|
47
|
-
companyId,
|
|
48
|
-
officerType,
|
|
49
|
-
fileId,
|
|
50
|
-
values: result.values,
|
|
51
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
52
|
-
})
|
|
53
|
-
: (0, onboardingCustomerViewReducer_1.applyKycDocumentAutofillForOnboarding)({
|
|
54
|
-
companyId,
|
|
55
|
-
officerType,
|
|
56
|
-
fileId,
|
|
57
|
-
values: result.values,
|
|
58
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
59
|
-
});
|
|
60
|
-
return (0, rxjs_1.of)(applyAction);
|
|
61
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)(failureAction)));
|
|
62
|
-
}));
|
|
63
|
-
exports.parseUploadedKycDocumentEpic = parseUploadedKycDocumentEpic;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trigger actions for the KYC / KYB autofill epics.
|
|
3
|
-
*
|
|
4
|
-
* These actions don't mutate state — the epic listens for them, calls
|
|
5
|
-
* document-communication-agent's sync endpoint, and dispatches the appropriate
|
|
6
|
-
* `applyKyc/KybDocumentAutofillFor{Setup,Onboarding}` against the matching
|
|
7
|
-
* slice. Co-located with the rest of the commonSetup module because the entire
|
|
8
|
-
* autofill flow is auxiliary to the setup view; there is no separate state.
|
|
9
|
-
*/
|
|
10
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
11
|
-
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
12
|
-
import { KybProvidedDocumentType, KycKybAutofillTarget, KycProvidedDocumentType } from './types/kycKybAutofill';
|
|
13
|
-
export interface ParseUploadedKycDocumentPayload {
|
|
14
|
-
companyId: ID;
|
|
15
|
-
documentType: KycProvidedDocumentType;
|
|
16
|
-
fileId: ID;
|
|
17
|
-
officerType: CompanyOfficerType;
|
|
18
|
-
target: KycKybAutofillTarget;
|
|
19
|
-
}
|
|
20
|
-
export interface ParseUploadedKybDocumentPayload {
|
|
21
|
-
companyId: ID;
|
|
22
|
-
documentType: KybProvidedDocumentType;
|
|
23
|
-
fileId: ID;
|
|
24
|
-
target: KycKybAutofillTarget;
|
|
25
|
-
}
|
|
26
|
-
export declare const parseUploadedKycDocument: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParseUploadedKycDocumentPayload, string>;
|
|
27
|
-
export declare const parseUploadedKybDocument: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParseUploadedKybDocumentPayload, string>;
|
|
28
|
-
export interface ParseUploadedDocumentFailurePayload {
|
|
29
|
-
fileId: ID;
|
|
30
|
-
target: KycKybAutofillTarget;
|
|
31
|
-
}
|
|
32
|
-
export declare const parseUploadedKycDocumentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParseUploadedDocumentFailurePayload, string>;
|
|
33
|
-
export declare const parseUploadedKybDocumentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParseUploadedDocumentFailurePayload, string>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Trigger actions for the KYC / KYB autofill epics.
|
|
4
|
-
*
|
|
5
|
-
* These actions don't mutate state — the epic listens for them, calls
|
|
6
|
-
* document-communication-agent's sync endpoint, and dispatches the appropriate
|
|
7
|
-
* `applyKyc/KybDocumentAutofillFor{Setup,Onboarding}` against the matching
|
|
8
|
-
* slice. Co-located with the rest of the commonSetup module because the entire
|
|
9
|
-
* autofill flow is auxiliary to the setup view; there is no separate state.
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.parseUploadedKybDocumentFailure = exports.parseUploadedKycDocumentFailure = exports.parseUploadedKybDocument = exports.parseUploadedKycDocument = void 0;
|
|
13
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
14
|
-
exports.parseUploadedKycDocument = (0, toolkit_1.createAction)('commonSetup/parseUploadedKycDocument');
|
|
15
|
-
exports.parseUploadedKybDocument = (0, toolkit_1.createAction)('commonSetup/parseUploadedKybDocument');
|
|
16
|
-
exports.parseUploadedKycDocumentFailure = (0, toolkit_1.createAction)('commonSetup/parseUploadedKycDocumentFailure');
|
|
17
|
-
exports.parseUploadedKybDocumentFailure = (0, toolkit_1.createAction)('commonSetup/parseUploadedKybDocumentFailure');
|
|
@@ -1,24 +0,0 @@
|
|
|
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 { Country } from '../../../entity/countryList/countryListState';
|
|
9
|
-
import { CompanyDetailsLocalData, CompanyOfficerLocalData } from './setupViewState';
|
|
10
|
-
import { ExtendCertificateOfIncorporationParsed, ExtendDrivingLicenseParsed, ExtendPassportParsed, ExtendSsnCardParsed, ExtendTaxEinParsed } from './types/kycKybAutofill';
|
|
11
|
-
export interface AutofillResult<TLocalData> {
|
|
12
|
-
autoFilledFieldNames: (keyof TLocalData & string)[];
|
|
13
|
-
values: Partial<TLocalData>;
|
|
14
|
-
}
|
|
15
|
-
/** Passport → Company Officer. */
|
|
16
|
-
export declare const mapPassportToOfficer: (parsed: ExtendPassportParsed, allNationalityCountries: Country[]) => AutofillResult<CompanyOfficerLocalData>;
|
|
17
|
-
/** Driving License → Company Officer. */
|
|
18
|
-
export declare const mapDrivingLicenseToOfficer: (parsed: ExtendDrivingLicenseParsed) => AutofillResult<CompanyOfficerLocalData>;
|
|
19
|
-
/** SSN Card → Company Officer (name only — SSN value not yet returned by parser). */
|
|
20
|
-
export declare const mapSsnCardToOfficer: (parsed: ExtendSsnCardParsed) => AutofillResult<CompanyOfficerLocalData>;
|
|
21
|
-
/** Certificate of Incorporation → Company Details. */
|
|
22
|
-
export declare const mapCoiToCompanyDetails: (parsed: ExtendCertificateOfIncorporationParsed) => AutofillResult<CompanyDetailsLocalData>;
|
|
23
|
-
/** Tax EIN letter → Company Details. */
|
|
24
|
-
export declare const mapTaxEinToCompanyDetails: (parsed: ExtendTaxEinParsed) => AutofillResult<CompanyDetailsLocalData>;
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Pure mappers from ExtendAI parser payloads to our form-side local-data shapes.
|
|
4
|
-
*
|
|
5
|
-
* Each mapper filters out fields below KYC_KYB_AUTOFILL_MIN_CONFIDENCE and returns
|
|
6
|
-
* both the merged values and the list of field names that were autofilled so the
|
|
7
|
-
* UI can show the ✦ AI badge next to each.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.mapTaxEinToCompanyDetails = exports.mapCoiToCompanyDetails = exports.mapSsnCardToOfficer = exports.mapDrivingLicenseToOfficer = exports.mapPassportToOfficer = void 0;
|
|
11
|
-
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
12
|
-
const zeniUrl_1 = require("../../../zeniUrl");
|
|
13
|
-
const kycKybAutofill_1 = require("./types/kycKybAutofill");
|
|
14
|
-
const emptyResult = () => ({
|
|
15
|
-
values: {},
|
|
16
|
-
autoFilledFieldNames: [],
|
|
17
|
-
});
|
|
18
|
-
const isConfident = (field) => {
|
|
19
|
-
if (field == null) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
if (field.value == null) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
return field.confidence >= kycKybAutofill_1.KYC_KYB_AUTOFILL_MIN_CONFIDENCE;
|
|
26
|
-
};
|
|
27
|
-
const assignAutofilledValue = (result, key, value) => {
|
|
28
|
-
if (value == null) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (typeof value === 'string' && value.trim() === '') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
result.values[key] = value;
|
|
35
|
-
result.autoFilledFieldNames.push(key);
|
|
36
|
-
};
|
|
37
|
-
const tryParseDate = (rawDate) => {
|
|
38
|
-
const parsedDate = (0, zeniDayJS_1.date)(rawDate);
|
|
39
|
-
if (parsedDate.isValid()) {
|
|
40
|
-
return parsedDate;
|
|
41
|
-
}
|
|
42
|
-
return undefined;
|
|
43
|
-
};
|
|
44
|
-
const normalizeNationality = (rawNationality, countries) => {
|
|
45
|
-
const needle = rawNationality.trim().toLowerCase();
|
|
46
|
-
if (needle === '') {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
// Exact ISO-2 / ISO-3 match.
|
|
50
|
-
const isoMatch = countries.find((country) => country.countryCode.toLowerCase() === needle);
|
|
51
|
-
if (isoMatch != null) {
|
|
52
|
-
return isoMatch.countryCode;
|
|
53
|
-
}
|
|
54
|
-
// Common nationality adjectives map to country names (e.g. "American" → "United States").
|
|
55
|
-
const adjectiveToCountry = {
|
|
56
|
-
american: 'united states',
|
|
57
|
-
british: 'united kingdom',
|
|
58
|
-
indian: 'india',
|
|
59
|
-
canadian: 'canada',
|
|
60
|
-
australian: 'australia',
|
|
61
|
-
german: 'germany',
|
|
62
|
-
french: 'france',
|
|
63
|
-
chinese: 'china',
|
|
64
|
-
japanese: 'japan',
|
|
65
|
-
mexican: 'mexico',
|
|
66
|
-
brazilian: 'brazil',
|
|
67
|
-
};
|
|
68
|
-
const resolvedName = adjectiveToCountry[needle] ?? needle;
|
|
69
|
-
const nameMatch = countries.find((country) => country.countryName.toLowerCase() === resolvedName);
|
|
70
|
-
return nameMatch?.countryCode;
|
|
71
|
-
};
|
|
72
|
-
const splitFullName = (fullName) => {
|
|
73
|
-
const parts = fullName.trim().split(/\s+/);
|
|
74
|
-
if (parts.length === 1) {
|
|
75
|
-
return { firstName: parts[0], lastName: '' };
|
|
76
|
-
}
|
|
77
|
-
const lastName = parts[parts.length - 1];
|
|
78
|
-
const firstName = parts.slice(0, -1).join(' ');
|
|
79
|
-
return { firstName, lastName };
|
|
80
|
-
};
|
|
81
|
-
/** Passport → Company Officer. */
|
|
82
|
-
const mapPassportToOfficer = (parsed, allNationalityCountries) => {
|
|
83
|
-
const result = emptyResult();
|
|
84
|
-
if (isConfident(parsed.first_name)) {
|
|
85
|
-
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
86
|
-
}
|
|
87
|
-
if (isConfident(parsed.last_name)) {
|
|
88
|
-
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
89
|
-
}
|
|
90
|
-
if (isConfident(parsed.date_of_birth)) {
|
|
91
|
-
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
92
|
-
if (parsedDate != null) {
|
|
93
|
-
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (isConfident(parsed.nationality)) {
|
|
97
|
-
const isoCode = normalizeNationality(parsed.nationality.value, allNationalityCountries);
|
|
98
|
-
if (isoCode != null) {
|
|
99
|
-
assignAutofilledValue(result, 'nationalityCountryCode', isoCode);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
};
|
|
104
|
-
exports.mapPassportToOfficer = mapPassportToOfficer;
|
|
105
|
-
/** Driving License → Company Officer. */
|
|
106
|
-
const mapDrivingLicenseToOfficer = (parsed) => {
|
|
107
|
-
const result = emptyResult();
|
|
108
|
-
if (isConfident(parsed.first_name)) {
|
|
109
|
-
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
110
|
-
}
|
|
111
|
-
if (isConfident(parsed.last_name)) {
|
|
112
|
-
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
113
|
-
}
|
|
114
|
-
if (isConfident(parsed.date_of_birth)) {
|
|
115
|
-
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
116
|
-
if (parsedDate != null) {
|
|
117
|
-
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// address_* fields are mapped at a higher layer (addressView reducer) — kept here as values
|
|
121
|
-
// only, the consuming epic dispatches the address payload separately.
|
|
122
|
-
return result;
|
|
123
|
-
};
|
|
124
|
-
exports.mapDrivingLicenseToOfficer = mapDrivingLicenseToOfficer;
|
|
125
|
-
/** SSN Card → Company Officer (name only — SSN value not yet returned by parser). */
|
|
126
|
-
const mapSsnCardToOfficer = (parsed) => {
|
|
127
|
-
const result = emptyResult();
|
|
128
|
-
if (isConfident(parsed.full_name)) {
|
|
129
|
-
const { firstName, lastName } = splitFullName(parsed.full_name.value);
|
|
130
|
-
if (firstName !== '') {
|
|
131
|
-
assignAutofilledValue(result, 'firstName', firstName);
|
|
132
|
-
}
|
|
133
|
-
if (lastName !== '') {
|
|
134
|
-
assignAutofilledValue(result, 'lastName', lastName);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return result;
|
|
138
|
-
};
|
|
139
|
-
exports.mapSsnCardToOfficer = mapSsnCardToOfficer;
|
|
140
|
-
/** Certificate of Incorporation → Company Details. */
|
|
141
|
-
const mapCoiToCompanyDetails = (parsed) => {
|
|
142
|
-
const result = emptyResult();
|
|
143
|
-
if (isConfident(parsed.company_legal_name)) {
|
|
144
|
-
assignAutofilledValue(result, 'companyLegalName', parsed.company_legal_name.value);
|
|
145
|
-
}
|
|
146
|
-
if (isConfident(parsed.ein)) {
|
|
147
|
-
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
148
|
-
}
|
|
149
|
-
if (isConfident(parsed.phone_number)) {
|
|
150
|
-
assignAutofilledValue(result, 'phone', parsed.phone_number.value);
|
|
151
|
-
}
|
|
152
|
-
if (isConfident(parsed.product_description)) {
|
|
153
|
-
assignAutofilledValue(result, 'companyDescription', parsed.product_description.value);
|
|
154
|
-
}
|
|
155
|
-
if (isConfident(parsed.website)) {
|
|
156
|
-
try {
|
|
157
|
-
assignAutofilledValue(result, 'website', (0, zeniUrl_1.toZeniUrl)(parsed.website.value));
|
|
158
|
-
}
|
|
159
|
-
catch {
|
|
160
|
-
// ignore — malformed URL string from OCR
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (isConfident(parsed.industry)) {
|
|
164
|
-
assignAutofilledValue(result, 'companyIndustryType', parsed.industry.value);
|
|
165
|
-
}
|
|
166
|
-
if (isConfident(parsed.sub_industry)) {
|
|
167
|
-
assignAutofilledValue(result, 'companySubIndustry', parsed.sub_industry.value);
|
|
168
|
-
}
|
|
169
|
-
if (isConfident(parsed.type_of_incorporation)) {
|
|
170
|
-
assignAutofilledValue(result, 'typeOfIncorporation', parsed.type_of_incorporation.value);
|
|
171
|
-
}
|
|
172
|
-
if (isConfident(parsed.date_of_incorporation)) {
|
|
173
|
-
const parsedDate = tryParseDate(parsed.date_of_incorporation.value);
|
|
174
|
-
if (parsedDate != null) {
|
|
175
|
-
assignAutofilledValue(result, 'incDate', parsedDate);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
if (isConfident(parsed.state_of_incorporation)) {
|
|
179
|
-
assignAutofilledValue(result, 'stateOfIncorporation', parsed.state_of_incorporation.value);
|
|
180
|
-
}
|
|
181
|
-
if (isConfident(parsed.countries_of_operations)) {
|
|
182
|
-
assignAutofilledValue(result, 'countriesOfOperations', parsed.countries_of_operations.value);
|
|
183
|
-
}
|
|
184
|
-
if (isConfident(parsed.source_of_funds)) {
|
|
185
|
-
assignAutofilledValue(result, 'sourceOfFunds', parsed.source_of_funds.value);
|
|
186
|
-
}
|
|
187
|
-
if (isConfident(parsed.transaction_volume_expectations)) {
|
|
188
|
-
assignAutofilledValue(result, 'transactionVolume', parsed.transaction_volume_expectations.value);
|
|
189
|
-
}
|
|
190
|
-
if (isConfident(parsed.purpose_of_account)) {
|
|
191
|
-
assignAutofilledValue(result, 'purposeOfAccount', parsed.purpose_of_account.value);
|
|
192
|
-
}
|
|
193
|
-
if (isConfident(parsed.regulated_status)) {
|
|
194
|
-
assignAutofilledValue(result, 'regulatedStatus', parsed.regulated_status.value);
|
|
195
|
-
}
|
|
196
|
-
if (isConfident(parsed.us_nexus)) {
|
|
197
|
-
assignAutofilledValue(result, 'usNexus', parsed.us_nexus.value);
|
|
198
|
-
}
|
|
199
|
-
return result;
|
|
200
|
-
};
|
|
201
|
-
exports.mapCoiToCompanyDetails = mapCoiToCompanyDetails;
|
|
202
|
-
/** Tax EIN letter → Company Details. */
|
|
203
|
-
const mapTaxEinToCompanyDetails = (parsed) => {
|
|
204
|
-
const result = emptyResult();
|
|
205
|
-
if (isConfident(parsed.legal_business_name)) {
|
|
206
|
-
assignAutofilledValue(result, 'companyLegalName', parsed.legal_business_name.value);
|
|
207
|
-
}
|
|
208
|
-
if (isConfident(parsed.ein)) {
|
|
209
|
-
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
210
|
-
}
|
|
211
|
-
return result;
|
|
212
|
-
};
|
|
213
|
-
exports.mapTaxEinToCompanyDetails = mapTaxEinToCompanyDetails;
|
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
import { ID } from '../../../../commonStateTypes/common';
|
|
11
|
-
/**
|
|
12
|
-
* Form-side identity document types as picked in `SelectDocumentField`.
|
|
13
|
-
* These are camelCase per the web-components convention.
|
|
14
|
-
*/
|
|
15
|
-
export type KycSelectDocumentType = 'driverLicense' | 'passport' | 'ssnCard' | 'stateId';
|
|
16
|
-
/**
|
|
17
|
-
* KYC document types accepted by the document-service parsers (snake_case).
|
|
18
|
-
* Subset of {@link KycKybProvidedDocumentType}. `stateId` from the form maps
|
|
19
|
-
* to no parser today and is skipped at dispatch time.
|
|
20
|
-
*/
|
|
21
|
-
export type KycProvidedDocumentType = 'passport' | 'driving_license' | 'social_security_card';
|
|
22
|
-
/** KYB document types accepted by the document-service parsers. */
|
|
23
|
-
export type KybProvidedDocumentType = 'certificate_of_incorporation' | 'tax_ein';
|
|
24
|
-
/** All KYC / KYB document types accepted by document-communication-agent. */
|
|
25
|
-
export type KycKybProvidedDocumentType = KycProvidedDocumentType | KybProvidedDocumentType;
|
|
26
|
-
/** Field value with model confidence (0..1) as returned by ExtendAI parsers. */
|
|
27
|
-
export interface FieldWithConfidence<T = string | null> {
|
|
28
|
-
confidence: number;
|
|
29
|
-
value: T | null;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Parser payloads — keep in sync with document-service
|
|
33
|
-
* `processors/parsers/extend_*_parser.py`.
|
|
34
|
-
*/
|
|
35
|
-
export interface ExtendPassportParsed {
|
|
36
|
-
date_of_birth?: FieldWithConfidence;
|
|
37
|
-
date_of_expiry?: FieldWithConfidence;
|
|
38
|
-
date_of_issue?: FieldWithConfidence;
|
|
39
|
-
first_name?: FieldWithConfidence;
|
|
40
|
-
gender?: FieldWithConfidence;
|
|
41
|
-
issuing_authority?: FieldWithConfidence;
|
|
42
|
-
last_name?: FieldWithConfidence;
|
|
43
|
-
mrz_line_1?: FieldWithConfidence;
|
|
44
|
-
mrz_line_2?: FieldWithConfidence;
|
|
45
|
-
nationality?: FieldWithConfidence;
|
|
46
|
-
passport_number?: FieldWithConfidence;
|
|
47
|
-
place_of_birth?: FieldWithConfidence;
|
|
48
|
-
}
|
|
49
|
-
export interface ExtendDrivingLicenseParsed {
|
|
50
|
-
address_city?: FieldWithConfidence;
|
|
51
|
-
address_state?: FieldWithConfidence;
|
|
52
|
-
address_street?: FieldWithConfidence;
|
|
53
|
-
address_zip?: FieldWithConfidence;
|
|
54
|
-
date_of_birth?: FieldWithConfidence;
|
|
55
|
-
date_of_expiry?: FieldWithConfidence;
|
|
56
|
-
date_of_issue?: FieldWithConfidence;
|
|
57
|
-
first_name?: FieldWithConfidence;
|
|
58
|
-
issuing_state?: FieldWithConfidence;
|
|
59
|
-
last_name?: FieldWithConfidence;
|
|
60
|
-
license_number?: FieldWithConfidence;
|
|
61
|
-
middle_name?: FieldWithConfidence;
|
|
62
|
-
}
|
|
63
|
-
export interface ExtendSsnCardParsed {
|
|
64
|
-
full_name?: FieldWithConfidence;
|
|
65
|
-
}
|
|
66
|
-
export interface ExtendCertificateOfIncorporationParsed {
|
|
67
|
-
company_address?: FieldWithConfidence;
|
|
68
|
-
company_legal_name?: FieldWithConfidence;
|
|
69
|
-
countries_of_operations?: FieldWithConfidence<string[]>;
|
|
70
|
-
date_of_incorporation?: FieldWithConfidence;
|
|
71
|
-
ein?: FieldWithConfidence;
|
|
72
|
-
industry?: FieldWithConfidence;
|
|
73
|
-
phone_number?: FieldWithConfidence;
|
|
74
|
-
product_description?: FieldWithConfidence;
|
|
75
|
-
purpose_of_account?: FieldWithConfidence;
|
|
76
|
-
registered_address?: FieldWithConfidence;
|
|
77
|
-
regulated_status?: FieldWithConfidence;
|
|
78
|
-
source_of_funds?: FieldWithConfidence;
|
|
79
|
-
state_of_incorporation?: FieldWithConfidence;
|
|
80
|
-
sub_industry?: FieldWithConfidence;
|
|
81
|
-
sub_us_nexus?: FieldWithConfidence;
|
|
82
|
-
transaction_volume_expectations?: FieldWithConfidence;
|
|
83
|
-
type_of_incorporation?: FieldWithConfidence;
|
|
84
|
-
us_nexus?: FieldWithConfidence;
|
|
85
|
-
website?: FieldWithConfidence;
|
|
86
|
-
}
|
|
87
|
-
export interface ExtendTaxEinParsed {
|
|
88
|
-
ein?: FieldWithConfidence;
|
|
89
|
-
irs_address?: FieldWithConfidence;
|
|
90
|
-
legal_business_name?: FieldWithConfidence;
|
|
91
|
-
trade_name?: FieldWithConfidence;
|
|
92
|
-
}
|
|
93
|
-
/** POST /1.0/documents/process/sync request body. */
|
|
94
|
-
export interface SyncDocumentsProcessRequest {
|
|
95
|
-
files: Array<{
|
|
96
|
-
file_id: ID;
|
|
97
|
-
}>;
|
|
98
|
-
provided_document_type: KycKybProvidedDocumentType;
|
|
99
|
-
metadata?: {
|
|
100
|
-
source?: string;
|
|
101
|
-
} & Record<string, unknown>;
|
|
102
|
-
processing_priority?: number;
|
|
103
|
-
}
|
|
104
|
-
/** POST /1.0/documents/process/sync response body. */
|
|
105
|
-
export interface SyncDocumentsProcessResponse {
|
|
106
|
-
data: ExtendPassportParsed | ExtendDrivingLicenseParsed | ExtendSsnCardParsed | ExtendCertificateOfIncorporationParsed | ExtendTaxEinParsed | null;
|
|
107
|
-
status: {
|
|
108
|
-
code: number;
|
|
109
|
-
message: string;
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Discriminator for which Redux slice to apply the autofill to — setup pages
|
|
114
|
-
* (`spendManagement/commonSetup`) and onboarding (`onboardingView/customerView`)
|
|
115
|
-
* share the same field shapes but live in separate slices.
|
|
116
|
-
*/
|
|
117
|
-
export type KycKybAutofillTarget = 'setup' | 'onboarding';
|
|
118
|
-
/** Confidence floor below which we drop an autofill candidate. */
|
|
119
|
-
export declare const KYC_KYB_AUTOFILL_MIN_CONFIDENCE = 0.5;
|
|
120
|
-
/**
|
|
121
|
-
* Maps the form-side {@link KycSelectDocumentType} (camelCase) to the
|
|
122
|
-
* parser-side {@link KycProvidedDocumentType} (snake_case). Returns `null` for
|
|
123
|
-
* `stateId`, which has no parser today.
|
|
124
|
-
*/
|
|
125
|
-
export declare const toKycProvidedDocumentType: (selectType: KycSelectDocumentType) => KycProvidedDocumentType | null;
|