@zeniai/client-epic-state 5.1.12 → 5.1.13-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/amount.d.ts +1 -0
- package/lib/commonStateTypes/amount.js +9 -1
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/commonStateTypes/workingDayHelper.d.ts +9 -0
- package/lib/commonStateTypes/workingDayHelper.js +28 -1
- 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 +20 -1
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +56 -0
- package/lib/entity/approvalRule/approvalRuleConflict.js +77 -0
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +34 -5
- package/lib/entity/approvalRule/approvalRulePayload.js +149 -10
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +25 -1
- package/lib/entity/approvalRule/approvalRuleSelector.js +40 -0
- package/lib/entity/approvalRule/approvalRuleState.d.ts +59 -7
- 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/cardsVisibilityHelpers.d.ts +4 -0
- package/lib/entity/company/cardsVisibilityHelpers.js +14 -0
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +6 -0
- package/lib/entity/company/companyStateTypes.d.ts +7 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +19 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -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 +9 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +5 -0
- package/lib/entity/task/taskPayload.d.ts +3 -1
- package/lib/entity/task/taskPayload.js +2 -0
- package/lib/entity/task/taskState.d.ts +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +8 -2
- package/lib/entity/tenant/clearAllEpic.js +12 -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 +59 -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 +70 -10
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -2
- package/lib/entity/transaction/stateTypes/transaction.d.ts +2 -0
- package/lib/epic.d.ts +31 -3
- package/lib/epic.js +32 -3
- package/lib/esm/commonStateTypes/amount.js +7 -0
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/commonStateTypes/workingDayHelper.js +26 -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 +17 -0
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +74 -0
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +149 -10
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +35 -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/cardsVisibilityHelpers.js +9 -0
- package/lib/esm/entity/company/companyPayload.js +6 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +19 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +8 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +5 -0
- package/lib/esm/entity/task/taskPayload.js +2 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +12 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +55 -0
- package/lib/esm/entity/tenant/tenantReducer.js +68 -8
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -2
- package/lib/esm/epic.js +32 -3
- package/lib/esm/index.js +68 -26
- package/lib/esm/reducer.js +18 -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/companyTaskManagerView/companyTaskManagerViewReducer.js +39 -11
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +14 -4
- package/lib/esm/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +38 -0
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
- package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +16 -0
- package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +3 -3
- package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/esm/view/dashboard/dashboardSelector.js +8 -43
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +40 -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/epic/customerDetails/updateOnboardingCustomerViewEpic.js +24 -18
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +29 -17
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +223 -51
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +36 -18
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +45 -6
- package/lib/esm/view/people/initializeEditPersonEpic.js +5 -1
- package/lib/esm/view/people/invitePeopleEpic.js +6 -3
- package/lib/esm/view/people/peopleSaveUpdatesEpic.js +7 -3
- package/lib/esm/view/settingsView/settingsViewHelpers.js +5 -2
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +22 -2
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +109 -12
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +54 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +144 -16
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +78 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +49 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +47 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +32 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +32 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +54 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +92 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +212 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +10 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +23 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +36 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +27 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +28 -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 +71 -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 +49 -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 +77 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +221 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +106 -52
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +41 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +61 -0
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +80 -11
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +7 -1
- package/lib/index.d.ts +83 -32
- package/lib/index.js +264 -29
- package/lib/reducer.d.ts +18 -0
- package/lib/reducer.js +18 -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/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +19 -11
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +11 -5
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +40 -12
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +2 -0
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +13 -3
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +11 -3
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.d.ts +10 -0
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +42 -0
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +1 -3
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.d.ts +6 -0
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +20 -0
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -2
- package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -2
- package/lib/view/dashboard/dashboardSelector.js +8 -43
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.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/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +44 -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/epic/customerDetails/updateOnboardingCustomerViewEpic.js +24 -18
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +27 -15
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +44 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +225 -52
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +6 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +39 -18
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +53 -8
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +47 -7
- package/lib/view/people/initializeEditPersonEpic.js +5 -1
- package/lib/view/people/invitePeopleEpic.js +6 -3
- package/lib/view/people/peopleSaveUpdatesEpic.js +7 -3
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.js +5 -2
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +8 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +21 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +22 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +7 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +110 -13
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +16 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +23 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +58 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +59 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +146 -17
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +31 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +47 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +34 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +23 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +82 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +40 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +53 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +37 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +53 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +14 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +36 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +36 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +56 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +60 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +22 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +96 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +59 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +217 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +122 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +13 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +27 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +9 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +40 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +31 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +15 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +32 -0
- 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 +75 -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 +9 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -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 +9 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +81 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +24 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +29 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +229 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +107 -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 +154 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +46 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +14 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +65 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +81 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +12 -0
- package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +7 -1
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure mappers from ExtendAI parser payloads to our form-side local-data shapes.
|
|
3
|
+
*
|
|
4
|
+
* Each mapper filters out fields below KYC_KYB_AUTOFILL_MIN_CONFIDENCE and returns
|
|
5
|
+
* both the merged values and the list of field names that were autofilled so the
|
|
6
|
+
* UI can show the ✦ AI badge next to each.
|
|
7
|
+
*/
|
|
8
|
+
import { date } from '../../../zeniDayJS';
|
|
9
|
+
import { toZeniUrl } from '../../../zeniUrl';
|
|
10
|
+
import { KYC_KYB_AUTOFILL_MIN_CONFIDENCE, } from './types/kycKybAutofill';
|
|
11
|
+
export const OFFICER_ADDRESS_AUTOFILL_FIELD = 'officerAddress';
|
|
12
|
+
// US driving licenses carry a US state in `address_state` but no country field;
|
|
13
|
+
// default the composed address to the US.
|
|
14
|
+
// Extend's driving-license parser is US-focused — its response shape
|
|
15
|
+
// (`ExtendDrivingLicenseParsed`) only returns `issuing_state`, no
|
|
16
|
+
// `issuing_country` / `country_of_issue`. So we default the address country
|
|
17
|
+
// to US for autofill purposes.
|
|
18
|
+
//
|
|
19
|
+
// `country` is the alpha-3 ISO code (matches the rest of the codebase's
|
|
20
|
+
// address payloads — e.g. `subscriptionBillingAddress.country = 'USA'`).
|
|
21
|
+
// The Edit Address form's country dropdown looks up the option by alpha-3,
|
|
22
|
+
// so using the country name here would leave the dropdown blank.
|
|
23
|
+
//
|
|
24
|
+
// To support non-US driving licenses later: (1) extend the document-service
|
|
25
|
+
// Extend workflow to return an issuing-country field, (2) add it to
|
|
26
|
+
// `ExtendDrivingLicenseParsed`, (3) read it here with this US value as the
|
|
27
|
+
// fallback when the parser couldn't determine the country.
|
|
28
|
+
const DRIVING_LICENSE_DEFAULT_COUNTRY = 'USA';
|
|
29
|
+
const DRIVING_LICENSE_DEFAULT_COUNTRY_CODE = 'US';
|
|
30
|
+
const emptyResult = () => ({
|
|
31
|
+
values: {},
|
|
32
|
+
autoFilledFieldNames: [],
|
|
33
|
+
});
|
|
34
|
+
const isConfident = (field) => {
|
|
35
|
+
if (field == null) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (field.value == null) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return field.confidence >= KYC_KYB_AUTOFILL_MIN_CONFIDENCE;
|
|
42
|
+
};
|
|
43
|
+
const assignAutofilledValue = (result, key, value) => {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (typeof value === 'string' && value.trim() === '') {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
result.values[key] = value;
|
|
51
|
+
result.autoFilledFieldNames.push(key);
|
|
52
|
+
};
|
|
53
|
+
const tryParseDate = (rawDate) => {
|
|
54
|
+
const parsedDate = date(rawDate);
|
|
55
|
+
if (parsedDate.isValid()) {
|
|
56
|
+
return parsedDate;
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
60
|
+
const splitFullName = (fullName) => {
|
|
61
|
+
const parts = fullName.trim().split(/\s+/);
|
|
62
|
+
if (parts.length === 1) {
|
|
63
|
+
return { firstName: parts[0], lastName: '' };
|
|
64
|
+
}
|
|
65
|
+
const lastName = parts[parts.length - 1];
|
|
66
|
+
const firstName = parts.slice(0, -1).join(' ');
|
|
67
|
+
return { firstName, lastName };
|
|
68
|
+
};
|
|
69
|
+
/** Passport → Company Officer. */
|
|
70
|
+
export const mapPassportToOfficer = (parsed) => {
|
|
71
|
+
const result = emptyResult();
|
|
72
|
+
if (isConfident(parsed.first_name)) {
|
|
73
|
+
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
74
|
+
}
|
|
75
|
+
if (isConfident(parsed.last_name)) {
|
|
76
|
+
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
77
|
+
}
|
|
78
|
+
if (isConfident(parsed.date_of_birth)) {
|
|
79
|
+
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
80
|
+
if (parsedDate != null) {
|
|
81
|
+
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// The raw nationality string (e.g. "USA", "UNITED STATES OF AMERICA") is
|
|
85
|
+
// passed through unresolved; the consuming form section normalizes it to an
|
|
86
|
+
// ISO-2 code via the `countries-list` dataset before `setValue`. The form
|
|
87
|
+
// value (not this localData seed) is what gets submitted.
|
|
88
|
+
if (isConfident(parsed.nationality)) {
|
|
89
|
+
assignAutofilledValue(result, 'nationalityCountryCode', parsed.nationality.value);
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
};
|
|
93
|
+
/** Driving License → Company Officer (name, DOB, and home address). */
|
|
94
|
+
export const mapDrivingLicenseToOfficer = (parsed) => {
|
|
95
|
+
const result = emptyResult();
|
|
96
|
+
if (isConfident(parsed.first_name)) {
|
|
97
|
+
assignAutofilledValue(result, 'firstName', parsed.first_name.value);
|
|
98
|
+
}
|
|
99
|
+
if (isConfident(parsed.last_name)) {
|
|
100
|
+
assignAutofilledValue(result, 'lastName', parsed.last_name.value);
|
|
101
|
+
}
|
|
102
|
+
if (isConfident(parsed.date_of_birth)) {
|
|
103
|
+
const parsedDate = tryParseDate(parsed.date_of_birth.value);
|
|
104
|
+
if (parsedDate != null) {
|
|
105
|
+
assignAutofilledValue(result, 'birthday', parsedDate);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// The officer address lives in the addressView slice rather than
|
|
109
|
+
// CompanyOfficerLocalData, so it's returned separately for the epic to
|
|
110
|
+
// dispatch via newAddressInLocalStore.
|
|
111
|
+
const street = isConfident(parsed.address_street)
|
|
112
|
+
? parsed.address_street.value.trim()
|
|
113
|
+
: undefined;
|
|
114
|
+
const city = isConfident(parsed.address_city)
|
|
115
|
+
? parsed.address_city.value.trim()
|
|
116
|
+
: undefined;
|
|
117
|
+
const state = isConfident(parsed.address_state)
|
|
118
|
+
? parsed.address_state.value.trim()
|
|
119
|
+
: undefined;
|
|
120
|
+
const postalCode = isConfident(parsed.address_zip)
|
|
121
|
+
? parsed.address_zip.value.trim()
|
|
122
|
+
: undefined;
|
|
123
|
+
if (street != null || city != null || state != null || postalCode != null) {
|
|
124
|
+
result.address = {
|
|
125
|
+
street: street != null ? [street] : [],
|
|
126
|
+
city: city ?? '',
|
|
127
|
+
state: state ?? '',
|
|
128
|
+
postalCode: postalCode ?? '',
|
|
129
|
+
country: DRIVING_LICENSE_DEFAULT_COUNTRY,
|
|
130
|
+
countryCode: DRIVING_LICENSE_DEFAULT_COUNTRY_CODE,
|
|
131
|
+
};
|
|
132
|
+
result.autoFilledFieldNames.push(OFFICER_ADDRESS_AUTOFILL_FIELD);
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
};
|
|
136
|
+
/** SSN Card → Company Officer (name only — SSN value not yet returned by parser). */
|
|
137
|
+
export const mapSsnCardToOfficer = (parsed) => {
|
|
138
|
+
const result = emptyResult();
|
|
139
|
+
if (isConfident(parsed.full_name)) {
|
|
140
|
+
const { firstName, lastName } = splitFullName(parsed.full_name.value);
|
|
141
|
+
if (firstName !== '') {
|
|
142
|
+
assignAutofilledValue(result, 'firstName', firstName);
|
|
143
|
+
}
|
|
144
|
+
if (lastName !== '') {
|
|
145
|
+
assignAutofilledValue(result, 'lastName', lastName);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
};
|
|
150
|
+
/** Certificate of Incorporation → Company Details. */
|
|
151
|
+
export const mapCoiToCompanyDetails = (parsed) => {
|
|
152
|
+
const result = emptyResult();
|
|
153
|
+
if (isConfident(parsed.company_legal_name)) {
|
|
154
|
+
assignAutofilledValue(result, 'companyLegalName', parsed.company_legal_name.value);
|
|
155
|
+
}
|
|
156
|
+
if (isConfident(parsed.ein)) {
|
|
157
|
+
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
158
|
+
}
|
|
159
|
+
if (isConfident(parsed.phone_number)) {
|
|
160
|
+
assignAutofilledValue(result, 'phone', parsed.phone_number.value);
|
|
161
|
+
}
|
|
162
|
+
if (isConfident(parsed.product_description)) {
|
|
163
|
+
assignAutofilledValue(result, 'companyDescription', parsed.product_description.value);
|
|
164
|
+
}
|
|
165
|
+
if (isConfident(parsed.website)) {
|
|
166
|
+
try {
|
|
167
|
+
assignAutofilledValue(result, 'website', toZeniUrl(parsed.website.value));
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// ignore — malformed URL string from OCR
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (isConfident(parsed.industry)) {
|
|
174
|
+
assignAutofilledValue(result, 'companyIndustryType', parsed.industry.value);
|
|
175
|
+
}
|
|
176
|
+
if (isConfident(parsed.sub_industry)) {
|
|
177
|
+
assignAutofilledValue(result, 'companySubIndustry', parsed.sub_industry.value);
|
|
178
|
+
}
|
|
179
|
+
if (isConfident(parsed.type_of_incorporation)) {
|
|
180
|
+
assignAutofilledValue(result, 'typeOfIncorporation', parsed.type_of_incorporation.value);
|
|
181
|
+
}
|
|
182
|
+
if (isConfident(parsed.date_of_incorporation)) {
|
|
183
|
+
const parsedDate = tryParseDate(parsed.date_of_incorporation.value);
|
|
184
|
+
if (parsedDate != null) {
|
|
185
|
+
assignAutofilledValue(result, 'incDate', parsedDate);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (isConfident(parsed.state_of_incorporation)) {
|
|
189
|
+
assignAutofilledValue(result, 'stateOfIncorporation', parsed.state_of_incorporation.value);
|
|
190
|
+
}
|
|
191
|
+
if (isConfident(parsed.countries_of_operations)) {
|
|
192
|
+
assignAutofilledValue(result, 'countriesOfOperations', parsed.countries_of_operations.value);
|
|
193
|
+
}
|
|
194
|
+
if (isConfident(parsed.source_of_funds)) {
|
|
195
|
+
assignAutofilledValue(result, 'sourceOfFunds', parsed.source_of_funds.value);
|
|
196
|
+
}
|
|
197
|
+
if (isConfident(parsed.transaction_volume_expectations)) {
|
|
198
|
+
assignAutofilledValue(result, 'transactionVolume', parsed.transaction_volume_expectations.value);
|
|
199
|
+
}
|
|
200
|
+
if (isConfident(parsed.purpose_of_account)) {
|
|
201
|
+
assignAutofilledValue(result, 'purposeOfAccount', parsed.purpose_of_account.value);
|
|
202
|
+
}
|
|
203
|
+
if (isConfident(parsed.regulated_status)) {
|
|
204
|
+
assignAutofilledValue(result, 'regulatedStatus', parsed.regulated_status.value);
|
|
205
|
+
}
|
|
206
|
+
if (isConfident(parsed.us_nexus)) {
|
|
207
|
+
assignAutofilledValue(result, 'usNexus', parsed.us_nexus.value);
|
|
208
|
+
}
|
|
209
|
+
return result;
|
|
210
|
+
};
|
|
211
|
+
/** Tax EIN letter → Company Details. */
|
|
212
|
+
export const mapTaxEinToCompanyDetails = (parsed) => {
|
|
213
|
+
const result = emptyResult();
|
|
214
|
+
if (isConfident(parsed.legal_business_name)) {
|
|
215
|
+
assignAutofilledValue(result, 'companyLegalName', parsed.legal_business_name.value);
|
|
216
|
+
}
|
|
217
|
+
if (isConfident(parsed.ein)) {
|
|
218
|
+
assignAutofilledValue(result, 'taxIdOrEIN', parsed.ein.value);
|
|
219
|
+
}
|
|
220
|
+
return result;
|
|
221
|
+
};
|
|
@@ -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,93 @@ 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
|
+
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds ?? [];
|
|
327
|
+
if (!draft.parsingDocumentFileIds.includes(fileId)) {
|
|
328
|
+
draft.parsingDocumentFileIds.push(fileId);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
const removeParsingFileId = (draft, fileId) => {
|
|
332
|
+
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
333
|
+
};
|
|
334
|
+
builder.addCase(parseUploadedKycDocument, (draft, action) => {
|
|
335
|
+
if (action.payload.target === 'setup') {
|
|
336
|
+
addParsingFileId(draft, action.payload.fileId);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
builder.addCase(parseUploadedKybDocument, (draft, action) => {
|
|
340
|
+
if (action.payload.target === 'setup') {
|
|
341
|
+
addParsingFileId(draft, action.payload.fileId);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
builder.addCase(parseUploadedKycDocumentFailure, (draft, action) => {
|
|
345
|
+
if (action.payload.target === 'setup') {
|
|
346
|
+
removeParsingFileId(draft, action.payload.fileId);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
builder.addCase(parseUploadedKybDocumentFailure, (draft, action) => {
|
|
350
|
+
if (action.payload.target === 'setup') {
|
|
351
|
+
removeParsingFileId(draft, action.payload.fileId);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
300
354
|
},
|
|
301
355
|
});
|
|
302
|
-
export const { enableSetup, enableSetupSuccess, enableSetupFailure, updateBusinessVerificationDetails, updateBusinessVerificationDetailsSuccess, updateBusinessVerificationDetailsFailure, updateSelectedCompanyOfficer, updateSetupViewLocalStoreData, saveSetupViewDataInLocalStore, saveCompnayOfficerPhoneInLocalStore, saveCompnayOfficerAdditionalDocumentsInLocalStore, saveTreasuryAdditionalDocumentsInLocalStore, sendOtp: sendOtpSpendManagementSetUp, resendOtp: resendOtpSpendManagementSetUp, sendOtpSuccess: sendOtpSuccessSpendManagementSetUp, sendOtpFailure: sendOtpFailureSpendManagementSetUp, verifyOtp: verifyOtpSpendManagementSetUp, verifyOtpSuccess: verifyOtpSuccessSpendManagementSetUp, verifyOtpFailure: verifyOtpFailureSpendManagementSetUp, saveIndustryAndIncDateInLocalStore, clearSetupViewDataInLocalStore, clearSetupView, } = setupView.actions;
|
|
356
|
+
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
357
|
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,41 @@
|
|
|
1
|
+
/** Confidence floor below which we drop an autofill candidate. */
|
|
2
|
+
export const KYC_KYB_AUTOFILL_MIN_CONFIDENCE = 0.5;
|
|
3
|
+
/**
|
|
4
|
+
* Maps the form-side {@link KycSelectDocumentType} (camelCase) to the
|
|
5
|
+
* parser-side {@link KycProvidedDocumentType} (snake_case). Returns `null` for
|
|
6
|
+
* `stateId`, which has no parser today.
|
|
7
|
+
*/
|
|
8
|
+
export const toKycProvidedDocumentType = (selectType) => {
|
|
9
|
+
switch (selectType) {
|
|
10
|
+
case 'driverLicense':
|
|
11
|
+
return 'driving_license';
|
|
12
|
+
case 'passport':
|
|
13
|
+
return 'passport';
|
|
14
|
+
case 'ssnCard':
|
|
15
|
+
return 'social_security_card';
|
|
16
|
+
case 'stateId':
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Maps a persisted {@link AllowedDocumentType} (snake_case — the value stored on
|
|
22
|
+
* an officer's `documentTypeSelectedForVerification`) to the parser-side
|
|
23
|
+
* {@link KycProvidedDocumentType}. Returns `null` for document types with no KYC
|
|
24
|
+
* parser today (e.g. `id_document` / state ID, and any non-identity doc).
|
|
25
|
+
*
|
|
26
|
+
* The officer's stored selection is an `AllowedDocumentType`, not a
|
|
27
|
+
* {@link KycSelectDocumentType}; use this — not {@link toKycProvidedDocumentType}
|
|
28
|
+
* — when triggering autofill off that field.
|
|
29
|
+
*/
|
|
30
|
+
export const toKycProvidedDocumentTypeFromAllowed = (allowedType) => {
|
|
31
|
+
switch (allowedType) {
|
|
32
|
+
case 'passport':
|
|
33
|
+
return 'passport';
|
|
34
|
+
case 'driving_license':
|
|
35
|
+
return 'driving_license';
|
|
36
|
+
case 'social_security_card':
|
|
37
|
+
return 'social_security_card';
|
|
38
|
+
default:
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
};
|
package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js
CHANGED
|
@@ -63,7 +63,11 @@ export const fetchEditRemiDetailPageEpic = (actions$, state$) => actions$.pipe(f
|
|
|
63
63
|
const approvalRules = state.remiSetupApproverViewState;
|
|
64
64
|
if (approvalRules.fetchState !== 'Completed' &&
|
|
65
65
|
approvalRules.fetchState !== 'In-Progress') {
|
|
66
|
-
|
|
66
|
+
// Side-fetch from the edit-reim page bootstrap. The
|
|
67
|
+
// triggering action doesn't carry the V3 flag, so we
|
|
68
|
+
// explicitly target v1; v3 tenants re-fetch via their
|
|
69
|
+
// own screen connector.
|
|
70
|
+
remiDetailActions.push(fetchRemiSetupApproverView(true, false, false, false));
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
@@ -6,9 +6,17 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
7
7
|
import { deleteRemiApprovalRule, deleteRemiApprovalRuleFailure, deleteRemiApprovalRuleSuccess, } from '../remiSetupApproverViewReducer';
|
|
8
8
|
export const deleteRemiApprovalRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteRemiApprovalRule.match), switchMap((action) => {
|
|
9
|
-
const { approvalRuleId } = action.payload;
|
|
9
|
+
const { approvalRuleId, useV3 } = action.payload;
|
|
10
|
+
// Approval Rules 3.0 — flag-gated endpoint selection.
|
|
11
|
+
// Explicit `=== true` keeps `strict-boolean-expressions` happy
|
|
12
|
+
// when RTK's payload type widens to `any` in some configs.
|
|
13
|
+
const endpoint = useV3 === true
|
|
14
|
+
? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2`
|
|
15
|
+
: `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules`;
|
|
10
16
|
return zeniAPI
|
|
11
|
-
.deleteAndGetJSON(
|
|
17
|
+
.deleteAndGetJSON(endpoint, {
|
|
18
|
+
approval_rule_id: approvalRuleId,
|
|
19
|
+
})
|
|
12
20
|
.pipe(mergeMap((response) => {
|
|
13
21
|
if (isSuccessResponse(response) && response.data != null) {
|
|
14
22
|
const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
@@ -6,7 +6,7 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
7
7
|
import { fetchRemiSetupApproverView, fetchRemiSetupApproverViewFailure, fetchRemiSetupApproverViewSuccess, } from '../remiSetupApproverViewReducer';
|
|
8
8
|
export const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchRemiSetupApproverView.match), switchMap((action) => {
|
|
9
|
-
const { cacheOverride, resolveAttributeToUser, includeImplicitActors } = action.payload;
|
|
9
|
+
const { cacheOverride, resolveAttributeToUser, includeImplicitActors, useV3, } = action.payload;
|
|
10
10
|
const { remiSetupApproverViewState, approvalRuleState } = state$.value;
|
|
11
11
|
const approvalRules = getApprovalRulesByIds(approvalRuleState, remiSetupApproverViewState.approvalRuleIds);
|
|
12
12
|
if (cacheOverride === true ||
|
|
@@ -14,8 +14,14 @@ export const fetchRemiSetupApproverViewEpic = (actions$, state$, zeniAPI) => act
|
|
|
14
14
|
remiSetupApproverViewState.approvalRuleIds.length ||
|
|
15
15
|
(remiSetupApproverViewState.hasValidState() === false &&
|
|
16
16
|
remiSetupApproverViewState.fetchState !== 'In-Progress')) {
|
|
17
|
+
// Approval Rules 3.0 — flag-gated endpoint selection.
|
|
18
|
+
// Explicit `=== true` keeps `strict-boolean-expressions` happy
|
|
19
|
+
// when RTK's payload type widens to `any` in some configs.
|
|
20
|
+
const basePath = useV3 === true
|
|
21
|
+
? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2`
|
|
22
|
+
: `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules`;
|
|
17
23
|
return zeniAPI
|
|
18
|
-
.getJSON(`${
|
|
24
|
+
.getJSON(`${basePath}?query={"is_include_implicit_actors": ${includeImplicitActors}, "is_resolve_attribute_to_user":${resolveAttributeToUser}}`)
|
|
19
25
|
.pipe(mergeMap((response) => {
|
|
20
26
|
if (isSuccessResponse(response) && response.data != null) {
|
|
21
27
|
const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { getApprovalRuleById } from '../../../../../entity/approvalRule/approvalRuleSelector';
|
|
3
|
+
import { getAmountCriteria, getApprovalRuleById, getDepartmentCriteria, getVendorCriteria, } from '../../../../../entity/approvalRule/approvalRuleSelector';
|
|
4
4
|
import { clearRemiSetupApproverViewUpdateData, initializeRemiSetupApproverViewUpdateData, saveRemiSetupApproverViewUpdateData, } from '../remiSetupApproverViewReducer';
|
|
5
5
|
export const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$) => actions$.pipe(filter(initializeRemiSetupApproverViewUpdateData.match), mergeMap((action) => {
|
|
6
6
|
const { approvalRuleId } = action.payload;
|
|
@@ -8,16 +8,20 @@ export const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$)
|
|
|
8
8
|
if (approvalRuleId != null) {
|
|
9
9
|
const approvalRule = getApprovalRuleById(state$.value.approvalRuleState, approvalRuleId);
|
|
10
10
|
if (approvalRule != null) {
|
|
11
|
-
const criteria = approvalRule.criteria[0];
|
|
12
|
-
const range = criteria?.range;
|
|
13
11
|
const remiSetupApproverViewUpdateData = {
|
|
14
12
|
approvalRuleId,
|
|
15
13
|
steps: approvalRule.steps,
|
|
16
14
|
criteria: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
amount: getAmountCriteria(approvalRule.criteria),
|
|
16
|
+
vendor: getVendorCriteria(approvalRule.criteria),
|
|
17
|
+
department: getDepartmentCriteria(approvalRule.criteria),
|
|
20
18
|
},
|
|
19
|
+
// Approval Rules 3.0 — seed rule-level fields so the form can
|
|
20
|
+
// round-trip them on edit. Each may be undefined on legacy rules.
|
|
21
|
+
name: approvalRule.name,
|
|
22
|
+
description: approvalRule.description,
|
|
23
|
+
separationOfDuties: approvalRule.separationOfDuties,
|
|
24
|
+
isFallback: approvalRule.isFallback,
|
|
21
25
|
};
|
|
22
26
|
fetchActions.push(clearRemiSetupApproverViewUpdateData(), saveRemiSetupApproverViewUpdateData(remiSetupApproverViewUpdateData));
|
|
23
27
|
}
|
|
@@ -25,7 +29,7 @@ export const initializeRemiSetupApproverViewUpdateDataEpic = (actions$, state$)
|
|
|
25
29
|
else {
|
|
26
30
|
const remiSetupApproverViewCreateData = {
|
|
27
31
|
steps: [],
|
|
28
|
-
criteria:
|
|
32
|
+
criteria: {},
|
|
29
33
|
};
|
|
30
34
|
fetchActions.push(clearRemiSetupApproverViewUpdateData(), saveRemiSetupApproverViewUpdateData(remiSetupApproverViewCreateData));
|
|
31
35
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
6
|
+
import { fetchRemiSetupApproverView, reorderRemiApprovalRules, reorderRemiApprovalRulesFailure, reorderRemiApprovalRulesSuccess, } from '../remiSetupApproverViewReducer';
|
|
7
|
+
export const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(reorderRemiApprovalRules.match), switchMap((action) => {
|
|
8
|
+
const { approvalRuleIds, useV3 } = action.payload;
|
|
9
|
+
const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2/reorder`;
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.putAndGetJSON(endpoint, {
|
|
12
|
+
rule_ids: approvalRuleIds,
|
|
13
|
+
})
|
|
14
|
+
.pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
+
const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
17
|
+
const actions = [
|
|
18
|
+
updateApprovalRules(response.data.approval_rules),
|
|
19
|
+
reorderRemiApprovalRulesSuccess(serverOrderedIds),
|
|
20
|
+
openSnackbar({
|
|
21
|
+
messageSection: `reimbursement_approval_reorder`,
|
|
22
|
+
messageText: 'success',
|
|
23
|
+
type: 'success',
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
26
|
+
return from(actions);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return from([
|
|
30
|
+
reorderRemiApprovalRulesFailure(response.status),
|
|
31
|
+
openSnackbar({
|
|
32
|
+
messageSection: `reimbursement_approval_reorder`,
|
|
33
|
+
messageText: 'failed',
|
|
34
|
+
type: 'error',
|
|
35
|
+
}),
|
|
36
|
+
// Failure-recovery refetch — match the screen connector
|
|
37
|
+
// convention '(cacheOverride, resolveAttributeToUser,
|
|
38
|
+
// includeImplicitActors, useV3)' rather than copying BillPay's
|
|
39
|
+
// 3-arg shape. With the previous useV3-as-default-false the
|
|
40
|
+
// V3 flag was being smuggled in as 'includeImplicitActors',
|
|
41
|
+
// which silently broke V3 recovery refetches.
|
|
42
|
+
fetchRemiSetupApproverView(true, false, false, useV3),
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
}), catchError((error) => from([
|
|
46
|
+
reorderRemiApprovalRulesFailure(createZeniAPIStatus('Unexpected Error', 'Reorder Reimbursement Approval Rules errored out' +
|
|
47
|
+
JSON.stringify(error))),
|
|
48
|
+
openSnackbar({
|
|
49
|
+
messageSection: `reimbursement_approval_reorder`,
|
|
50
|
+
messageText: 'failed',
|
|
51
|
+
type: 'error',
|
|
52
|
+
}),
|
|
53
|
+
// Failure-recovery refetch — match the screen connector
|
|
54
|
+
// convention '(cacheOverride, resolveAttributeToUser,
|
|
55
|
+
// includeImplicitActors, useV3)' rather than copying BillPay's
|
|
56
|
+
// 3-arg shape. With the previous useV3-as-default-false the
|
|
57
|
+
// V3 flag was being smuggled in as 'includeImplicitActors',
|
|
58
|
+
// which silently broke V3 recovery refetches.
|
|
59
|
+
fetchRemiSetupApproverView(true, false, false, useV3),
|
|
60
|
+
])));
|
|
61
|
+
}));
|