@zeniai/client-epic-state 5.0.92 → 5.0.93-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.
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +63 -5
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +249 -9
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +4 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +19 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +97 -4
- package/lib/entity/aiCfo/aiCfoState.js +18 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +175 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +99 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +68 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +24 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +105 -0
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +4 -0
- package/lib/entity/company/companyStateTypes.d.ts +4 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +4 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -2
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
- 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 +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +38 -25
- package/lib/entity/tenant/tenantReducer.js +65 -5
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/epic.d.ts +19 -1
- package/lib/epic.js +20 -1
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +249 -9
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +17 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +15 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +171 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +75 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +64 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +101 -0
- package/lib/esm/entity/company/companyPayload.js +4 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +3 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
- package/lib/esm/entity/tenant/tenantReducer.js +63 -3
- package/lib/esm/epic.js +20 -1
- package/lib/esm/index.js +46 -13
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- 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/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +42 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +29 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +217 -50
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +7 -1
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +12 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +52 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +36 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +34 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +58 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +38 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +289 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +109 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +44 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +111 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +363 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +36 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +19 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +6 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +119 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +154 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +140 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +20 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +100 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +96 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +59 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +24 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +34 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +57 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +35 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +42 -4
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +35 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +62 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +44 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +58 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +67 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +205 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +105 -52
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +28 -0
- package/lib/index.d.ts +52 -14
- package/lib/index.js +219 -31
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- 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/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +46 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +8 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +33 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +9 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +44 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +41 -4
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +219 -51
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +5 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +11 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +40 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +56 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +40 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +43 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +38 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +62 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +294 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +113 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +48 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +115 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +29 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +369 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +6 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +40 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +26 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +116 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +10 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +33 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +126 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +52 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +158 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +31 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +43 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +10 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +144 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +24 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +104 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +22 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +100 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +63 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +28 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +34 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +38 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +61 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +39 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +12 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +43 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +42 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +5 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +66 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +48 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +28 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +62 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +30 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +71 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +33 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +24 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +213 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +106 -53
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +7 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +19 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +142 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +32 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { getCountryList } from '../../../../../entity/countryList/countryListSelector';
|
|
4
|
+
import { isSuccessResponse } from '../../../../../responsePayload';
|
|
5
|
+
import { applyKycDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
6
|
+
import { parseUploadedKycDocument, parseUploadedKycDocumentFailure, } from '../../kycKybAutofillActions';
|
|
7
|
+
import { mapDrivingLicenseToOfficer, mapPassportToOfficer, mapSsnCardToOfficer, } from '../../kycKybParseMapper';
|
|
8
|
+
import { applyKycDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
9
|
+
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
10
|
+
export const parseUploadedKycDocumentEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(parseUploadedKycDocument.match), mergeMap((action) => {
|
|
11
|
+
const { target, companyId, officerType, fileId, documentType } = action.payload;
|
|
12
|
+
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
13
|
+
const requestPayload = {
|
|
14
|
+
provided_document_type: documentType,
|
|
15
|
+
files: [{ file_id: fileId }],
|
|
16
|
+
processing_priority: 10,
|
|
17
|
+
metadata: { source: 'kyc_kyb_autofill' },
|
|
18
|
+
};
|
|
19
|
+
const failureAction = parseUploadedKycDocumentFailure({ target, fileId });
|
|
20
|
+
return zeniAPI
|
|
21
|
+
.postAndGetJSON(url, requestPayload)
|
|
22
|
+
.pipe(mergeMap((response) => {
|
|
23
|
+
if (!isSuccessResponse(response) || response.data == null) {
|
|
24
|
+
return of(failureAction);
|
|
25
|
+
}
|
|
26
|
+
// Sync API returns a batch envelope: `data.files[0].extracted_data`
|
|
27
|
+
// is the parser payload; `data` itself is the request-level wrapper
|
|
28
|
+
// ({request_id, status, files, metadata, ...}). Drill in before
|
|
29
|
+
// dispatching to the mapper.
|
|
30
|
+
const extracted = response.data.files?.[0]?.extracted_data;
|
|
31
|
+
if (extracted == null) {
|
|
32
|
+
return of(failureAction);
|
|
33
|
+
}
|
|
34
|
+
const allCountries = getCountryList(state$.value.countryListState, 'nationalityCountryList').countries;
|
|
35
|
+
let result;
|
|
36
|
+
switch (documentType) {
|
|
37
|
+
case 'passport':
|
|
38
|
+
result = mapPassportToOfficer(extracted, allCountries);
|
|
39
|
+
break;
|
|
40
|
+
case 'driving_license':
|
|
41
|
+
result = mapDrivingLicenseToOfficer(extracted);
|
|
42
|
+
break;
|
|
43
|
+
case 'social_security_card':
|
|
44
|
+
result = mapSsnCardToOfficer(extracted);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
if (result.autoFilledFieldNames.length === 0) {
|
|
48
|
+
return of(failureAction);
|
|
49
|
+
}
|
|
50
|
+
const applyAction = target === 'setup'
|
|
51
|
+
? applyKycDocumentAutofillForSetup({
|
|
52
|
+
companyId,
|
|
53
|
+
officerType,
|
|
54
|
+
fileId,
|
|
55
|
+
values: result.values,
|
|
56
|
+
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
57
|
+
})
|
|
58
|
+
: applyKycDocumentAutofillForOnboarding({
|
|
59
|
+
companyId,
|
|
60
|
+
officerType,
|
|
61
|
+
fileId,
|
|
62
|
+
values: result.values,
|
|
63
|
+
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
64
|
+
});
|
|
65
|
+
return of(applyAction);
|
|
66
|
+
}), catchError(() => of(failureAction)));
|
|
67
|
+
}));
|
|
@@ -0,0 +1,14 @@
|
|
|
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 { createAction } from '@reduxjs/toolkit';
|
|
11
|
+
export const parseUploadedKycDocument = createAction('commonSetup/parseUploadedKycDocument');
|
|
12
|
+
export const parseUploadedKybDocument = createAction('commonSetup/parseUploadedKybDocument');
|
|
13
|
+
export const parseUploadedKycDocumentFailure = createAction('commonSetup/parseUploadedKycDocumentFailure');
|
|
14
|
+
export const parseUploadedKybDocumentFailure = createAction('commonSetup/parseUploadedKybDocumentFailure');
|
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
const emptyResult = () => ({
|
|
12
|
+
values: {},
|
|
13
|
+
autoFilledFieldNames: [],
|
|
14
|
+
});
|
|
15
|
+
const isConfident = (field) => {
|
|
16
|
+
if (field == null) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (field.value == null) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return field.confidence >= KYC_KYB_AUTOFILL_MIN_CONFIDENCE;
|
|
23
|
+
};
|
|
24
|
+
const assignAutofilledValue = (result, key, value) => {
|
|
25
|
+
if (value == null) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (typeof value === 'string' && value.trim() === '') {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
result.values[key] = value;
|
|
32
|
+
result.autoFilledFieldNames.push(key);
|
|
33
|
+
};
|
|
34
|
+
const tryParseDate = (rawDate) => {
|
|
35
|
+
const parsedDate = date(rawDate);
|
|
36
|
+
if (parsedDate.isValid()) {
|
|
37
|
+
return parsedDate;
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
const normalizeNationality = (rawNationality, countries) => {
|
|
42
|
+
const needle = rawNationality.trim().toLowerCase();
|
|
43
|
+
if (needle === '') {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
// Exact ISO-2 / ISO-3 match.
|
|
47
|
+
const isoMatch = countries.find((country) => country.countryCode.toLowerCase() === needle);
|
|
48
|
+
if (isoMatch != null) {
|
|
49
|
+
return isoMatch.countryCode;
|
|
50
|
+
}
|
|
51
|
+
// Common nationality adjectives map to country names (e.g. "American" → "United States").
|
|
52
|
+
const adjectiveToCountry = {
|
|
53
|
+
american: 'united states',
|
|
54
|
+
british: 'united kingdom',
|
|
55
|
+
indian: 'india',
|
|
56
|
+
canadian: 'canada',
|
|
57
|
+
australian: 'australia',
|
|
58
|
+
german: 'germany',
|
|
59
|
+
french: 'france',
|
|
60
|
+
chinese: 'china',
|
|
61
|
+
japanese: 'japan',
|
|
62
|
+
mexican: 'mexico',
|
|
63
|
+
brazilian: 'brazil',
|
|
64
|
+
};
|
|
65
|
+
const resolvedName = adjectiveToCountry[needle] ?? needle;
|
|
66
|
+
const nameMatch = countries.find((country) => country.countryName.toLowerCase() === resolvedName);
|
|
67
|
+
return nameMatch?.countryCode;
|
|
68
|
+
};
|
|
69
|
+
const splitFullName = (fullName) => {
|
|
70
|
+
const parts = fullName.trim().split(/\s+/);
|
|
71
|
+
if (parts.length === 1) {
|
|
72
|
+
return { firstName: parts[0], lastName: '' };
|
|
73
|
+
}
|
|
74
|
+
const lastName = parts[parts.length - 1];
|
|
75
|
+
const firstName = parts.slice(0, -1).join(' ');
|
|
76
|
+
return { firstName, lastName };
|
|
77
|
+
};
|
|
78
|
+
/** Passport → Company Officer. */
|
|
79
|
+
export const mapPassportToOfficer = (parsed, allNationalityCountries) => {
|
|
80
|
+
const result = emptyResult();
|
|
81
|
+
if (isConfident(parsed.first_name)) {
|
|
82
|
+
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
83
|
+
}
|
|
84
|
+
if (isConfident(parsed.last_name)) {
|
|
85
|
+
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
86
|
+
}
|
|
87
|
+
if (isConfident(parsed.date_of_birth)) {
|
|
88
|
+
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
89
|
+
if (parsedDate != null) {
|
|
90
|
+
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (isConfident(parsed.nationality)) {
|
|
94
|
+
const isoCode = normalizeNationality(parsed.nationality.value, allNationalityCountries);
|
|
95
|
+
if (isoCode != null) {
|
|
96
|
+
assignAutofilledValue(result, 'nationalityCountryCode', isoCode);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
};
|
|
101
|
+
/** Driving License → Company Officer. */
|
|
102
|
+
export const mapDrivingLicenseToOfficer = (parsed) => {
|
|
103
|
+
const result = emptyResult();
|
|
104
|
+
if (isConfident(parsed.first_name)) {
|
|
105
|
+
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
106
|
+
}
|
|
107
|
+
if (isConfident(parsed.last_name)) {
|
|
108
|
+
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
109
|
+
}
|
|
110
|
+
if (isConfident(parsed.date_of_birth)) {
|
|
111
|
+
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
112
|
+
if (parsedDate != null) {
|
|
113
|
+
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// address_* fields are mapped at a higher layer (addressView reducer) — kept here as values
|
|
117
|
+
// only, the consuming epic dispatches the address payload separately.
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
/** SSN Card → Company Officer (name only — SSN value not yet returned by parser). */
|
|
121
|
+
export const mapSsnCardToOfficer = (parsed) => {
|
|
122
|
+
const result = emptyResult();
|
|
123
|
+
if (isConfident(parsed.full_name)) {
|
|
124
|
+
const { firstName, lastName } = splitFullName(parsed.full_name.value);
|
|
125
|
+
if (firstName !== '') {
|
|
126
|
+
assignAutofilledValue(result, 'firstName', firstName);
|
|
127
|
+
}
|
|
128
|
+
if (lastName !== '') {
|
|
129
|
+
assignAutofilledValue(result, 'lastName', lastName);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
};
|
|
134
|
+
/** Certificate of Incorporation → Company Details. */
|
|
135
|
+
export const mapCoiToCompanyDetails = (parsed) => {
|
|
136
|
+
const result = emptyResult();
|
|
137
|
+
if (isConfident(parsed.company_legal_name)) {
|
|
138
|
+
assignAutofilledValue(result, 'companyLegalName', parsed.company_legal_name.value);
|
|
139
|
+
}
|
|
140
|
+
if (isConfident(parsed.ein)) {
|
|
141
|
+
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
142
|
+
}
|
|
143
|
+
if (isConfident(parsed.phone_number)) {
|
|
144
|
+
assignAutofilledValue(result, 'phone', parsed.phone_number.value);
|
|
145
|
+
}
|
|
146
|
+
if (isConfident(parsed.product_description)) {
|
|
147
|
+
assignAutofilledValue(result, 'companyDescription', parsed.product_description.value);
|
|
148
|
+
}
|
|
149
|
+
if (isConfident(parsed.website)) {
|
|
150
|
+
try {
|
|
151
|
+
assignAutofilledValue(result, 'website', toZeniUrl(parsed.website.value));
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// ignore — malformed URL string from OCR
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (isConfident(parsed.industry)) {
|
|
158
|
+
assignAutofilledValue(result, 'companyIndustryType', parsed.industry.value);
|
|
159
|
+
}
|
|
160
|
+
if (isConfident(parsed.sub_industry)) {
|
|
161
|
+
assignAutofilledValue(result, 'companySubIndustry', parsed.sub_industry.value);
|
|
162
|
+
}
|
|
163
|
+
if (isConfident(parsed.type_of_incorporation)) {
|
|
164
|
+
assignAutofilledValue(result, 'typeOfIncorporation', parsed.type_of_incorporation.value);
|
|
165
|
+
}
|
|
166
|
+
if (isConfident(parsed.date_of_incorporation)) {
|
|
167
|
+
const parsedDate = tryParseDate(parsed.date_of_incorporation.value);
|
|
168
|
+
if (parsedDate != null) {
|
|
169
|
+
assignAutofilledValue(result, 'incDate', parsedDate);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (isConfident(parsed.state_of_incorporation)) {
|
|
173
|
+
assignAutofilledValue(result, 'stateOfIncorporation', parsed.state_of_incorporation.value);
|
|
174
|
+
}
|
|
175
|
+
if (isConfident(parsed.countries_of_operations)) {
|
|
176
|
+
assignAutofilledValue(result, 'countriesOfOperations', parsed.countries_of_operations.value);
|
|
177
|
+
}
|
|
178
|
+
if (isConfident(parsed.source_of_funds)) {
|
|
179
|
+
assignAutofilledValue(result, 'sourceOfFunds', parsed.source_of_funds.value);
|
|
180
|
+
}
|
|
181
|
+
if (isConfident(parsed.transaction_volume_expectations)) {
|
|
182
|
+
assignAutofilledValue(result, 'transactionVolume', parsed.transaction_volume_expectations.value);
|
|
183
|
+
}
|
|
184
|
+
if (isConfident(parsed.purpose_of_account)) {
|
|
185
|
+
assignAutofilledValue(result, 'purposeOfAccount', parsed.purpose_of_account.value);
|
|
186
|
+
}
|
|
187
|
+
if (isConfident(parsed.regulated_status)) {
|
|
188
|
+
assignAutofilledValue(result, 'regulatedStatus', parsed.regulated_status.value);
|
|
189
|
+
}
|
|
190
|
+
if (isConfident(parsed.us_nexus)) {
|
|
191
|
+
assignAutofilledValue(result, 'usNexus', parsed.us_nexus.value);
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
};
|
|
195
|
+
/** Tax EIN letter → Company Details. */
|
|
196
|
+
export const mapTaxEinToCompanyDetails = (parsed) => {
|
|
197
|
+
const result = emptyResult();
|
|
198
|
+
if (isConfident(parsed.legal_business_name)) {
|
|
199
|
+
assignAutofilledValue(result, 'companyLegalName', parsed.legal_business_name.value);
|
|
200
|
+
}
|
|
201
|
+
if (isConfident(parsed.ein)) {
|
|
202
|
+
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
};
|
|
@@ -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
|
-
|
|
15
|
+
parsingDocumentFileIds: [],
|
|
16
|
+
companyDetails: { autoFilledFields: [] },
|
|
9
17
|
companyOfficerUpdateStatus: {
|
|
10
|
-
Officer_1: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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,28 @@
|
|
|
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
|
+
};
|