@zeniai/client-epic-state 5.1.13 → 5.1.14
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 +0 -1
- package/lib/commonStateTypes/amount.js +1 -9
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +0 -1
- package/lib/commonStateTypes/workingDayHelper.d.ts +0 -9
- package/lib/commonStateTypes/workingDayHelper.js +1 -28
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +5 -63
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +2 -23
- package/lib/entity/aiCfo/aiCfoReducer.js +9 -249
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -4
- package/lib/entity/aiCfo/aiCfoSelector.js +1 -19
- package/lib/entity/aiCfo/aiCfoState.d.ts +4 -97
- package/lib/entity/aiCfo/aiCfoState.js +1 -20
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -34
- package/lib/entity/approvalRule/approvalRulePayload.js +10 -149
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
- package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
- package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -59
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -6
- package/lib/entity/company/companyStateTypes.d.ts +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -19
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -2
- 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 +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -9
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -5
- package/lib/entity/task/taskPayload.d.ts +1 -3
- package/lib/entity/task/taskPayload.js +0 -2
- package/lib/entity/task/taskState.d.ts +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -8
- package/lib/entity/tenant/clearAllEpic.js +0 -12
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +10 -70
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +2 -14
- package/lib/epic.d.ts +3 -31
- package/lib/epic.js +3 -32
- package/lib/esm/commonStateTypes/amount.js +0 -7
- package/lib/esm/commonStateTypes/animations.js +0 -1
- package/lib/esm/commonStateTypes/workingDayHelper.js +0 -26
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +9 -249
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +1 -17
- package/lib/esm/entity/aiCfo/aiCfoState.js +0 -17
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -149
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
- package/lib/esm/entity/company/companyPayload.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -19
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -8
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -5
- package/lib/esm/entity/task/taskPayload.js +0 -2
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -12
- package/lib/esm/entity/tenant/tenantReducer.js +8 -68
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +2 -14
- package/lib/esm/epic.js +3 -32
- package/lib/esm/index.js +25 -66
- package/lib/esm/reducer.js +0 -18
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +11 -39
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +4 -14
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
- 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/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/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +17 -29
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -223
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +18 -36
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +6 -45
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +2 -22
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -14
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +12 -109
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -144
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -60
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +2 -8
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -25
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +4 -42
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +0 -35
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -106
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +1 -5
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -80
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +0 -1
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +0 -6
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +1 -7
- package/lib/index.d.ts +32 -82
- package/lib/index.js +34 -266
- package/lib/reducer.d.ts +0 -18
- package/lib/reducer.js +0 -18
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +2 -11
- package/lib/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +1 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/view/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +11 -19
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +5 -11
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +12 -40
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +0 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -13
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +3 -11
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +3 -1
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
- 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 +2 -3
- 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/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +15 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +5 -44
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +52 -225
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -6
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +18 -39
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +8 -53
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +7 -47
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +1 -8
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -21
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +0 -22
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +0 -7
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +13 -110
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +0 -16
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -59
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +17 -146
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -8
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -60
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +2 -8
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -27
- 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 +2 -12
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +5 -43
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +1 -42
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +0 -5
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -107
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +1 -5
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +12 -81
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +0 -12
- 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 +0 -1
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +0 -6
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +1 -7
- package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +4 -6
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +0 -56
- package/lib/entity/approvalRule/approvalRuleConflict.js +0 -77
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +0 -277
- package/lib/entity/cardPolicy/cardPolicyPayload.js +0 -143
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +0 -19
- package/lib/entity/cardPolicy/cardPolicyReducer.js +0 -175
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +0 -32
- package/lib/entity/cardPolicy/cardPolicySelector.js +0 -99
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +0 -205
- package/lib/entity/cardPolicy/cardPolicyState.js +0 -14
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +0 -18
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -68
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +0 -26
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -47
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +0 -25
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -39
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +0 -24
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -105
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -59
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +0 -74
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +0 -130
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +0 -171
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +0 -75
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +0 -9
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -64
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -43
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -35
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -101
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -55
- package/lib/esm/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +0 -38
- package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +0 -16
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -40
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -29
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -78
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -49
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -47
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -92
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -212
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -10
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -23
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -36
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -27
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -28
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -52
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -36
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -39
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -71
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -21
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -38
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -289
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -109
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -44
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -111
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -25
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -363
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -36
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -19
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -6
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -119
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -154
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -49
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -140
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -20
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -100
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -96
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -59
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -24
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -57
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -35
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -62
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -44
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -58
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -77
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -221
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -41
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -61
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.d.ts +0 -10
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +0 -42
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.d.ts +0 -6
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +0 -20
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -44
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +0 -23
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -58
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +0 -47
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -34
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +0 -23
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -82
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +0 -40
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +0 -37
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +0 -14
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +0 -56
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -60
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +0 -22
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -96
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +0 -59
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -217
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +0 -122
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -13
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -27
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +0 -9
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -40
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -31
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +0 -15
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -32
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -56
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -28
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -43
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -75
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -27
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -294
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -113
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -48
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -115
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -29
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -369
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -26
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +0 -116
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -10
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +0 -33
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -126
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +0 -52
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -158
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -31
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -53
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +0 -10
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -144
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -24
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -104
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +0 -22
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -100
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -63
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -28
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +0 -34
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -38
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -61
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -39
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -66
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -48
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -62
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -81
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -29
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -229
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -154
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -46
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +0 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -65
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION, } from './cardPolicyFormDraftTypes';
|
|
2
|
-
import { REVIEW_GROUP_IDS, REVIEW_LIMIT_CHIP_IDS, amountFromLimitRow, collectCategoryCodes, collectMerchantNames, } from './cardPolicyRequestParts';
|
|
3
|
-
const isSelectedChip = (chip) => chip.isSelected !== false;
|
|
4
|
-
const chipsInGroup = (row, groupId) => {
|
|
5
|
-
const group = row.chipGroups.find((g) => g.id === groupId);
|
|
6
|
-
if (group == null) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
return group.chips.filter(isSelectedChip);
|
|
10
|
-
};
|
|
11
|
-
const collectVendorLabelsFromReviewRow = (row, groupId) => chipsInGroup(row, groupId).map((chip) => chip.label);
|
|
12
|
-
const collectCategoryCodesFromReviewRow = (row, groupId) => chipsInGroup(row, groupId).map((chip) => chip.optionalCode ?? chip.id);
|
|
13
|
-
const collectCardIdsFromReviewRow = (row) => chipsInGroup(row, REVIEW_GROUP_IDS.appliedToCards).flatMap((chip) => chip.cardIds ?? []);
|
|
14
|
-
const limitValueFromReviewRow = (row, chipId) => {
|
|
15
|
-
const group = row.chipGroups.find((g) => g.id === REVIEW_GROUP_IDS.limits);
|
|
16
|
-
if (group == null) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
const chip = group.chips.find((c) => c.id === chipId && isSelectedChip(c));
|
|
20
|
-
if (chip == null) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
if (chip.optionalCode != null) {
|
|
24
|
-
const parsed = Number(chip.optionalCode);
|
|
25
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
26
|
-
}
|
|
27
|
-
const labelDigits = chip.label.match(/\d+(?:\.\d+)?/);
|
|
28
|
-
if (labelDigits == null) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const parsed = Number(labelDigits[0]);
|
|
32
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
33
|
-
};
|
|
34
|
-
const buildGuidedEntry = (row, draft, guidedMode, description) => ({
|
|
35
|
-
allowedEntity: {
|
|
36
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'allow'),
|
|
37
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'allow'),
|
|
38
|
-
},
|
|
39
|
-
applyToCards: draft.cardSelections
|
|
40
|
-
.filter((card) => card.isChecked)
|
|
41
|
-
.map((card) => card.id),
|
|
42
|
-
blockedEntity: {
|
|
43
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'block'),
|
|
44
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'block'),
|
|
45
|
-
},
|
|
46
|
-
description: description.trim(),
|
|
47
|
-
mode: guidedMode,
|
|
48
|
-
name: row.name.trim(),
|
|
49
|
-
requiredReceiptThreshold: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT),
|
|
50
|
-
spendLimits: {
|
|
51
|
-
transaction: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION),
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
const buildAutoEntry = (row, description) => ({
|
|
55
|
-
allowedEntity: {
|
|
56
|
-
categoryCodes: collectCategoryCodesFromReviewRow(row, REVIEW_GROUP_IDS.allowedCategories),
|
|
57
|
-
merchantNames: collectVendorLabelsFromReviewRow(row, REVIEW_GROUP_IDS.allowedVendors),
|
|
58
|
-
},
|
|
59
|
-
applyToCards: collectCardIdsFromReviewRow(row),
|
|
60
|
-
blockedEntity: {
|
|
61
|
-
categoryCodes: collectCategoryCodesFromReviewRow(row, REVIEW_GROUP_IDS.restrictedCategories),
|
|
62
|
-
merchantNames: collectVendorLabelsFromReviewRow(row, REVIEW_GROUP_IDS.blockedVendors),
|
|
63
|
-
},
|
|
64
|
-
description: description.trim(),
|
|
65
|
-
name: row.name.trim(),
|
|
66
|
-
});
|
|
67
|
-
const buildUploadEntry = (row, draft, description) => ({
|
|
68
|
-
allowedEntity: {
|
|
69
|
-
categoryCodes: collectCategoryCodesFromReviewRow(row, REVIEW_GROUP_IDS.allowedCategories),
|
|
70
|
-
merchantNames: collectVendorLabelsFromReviewRow(row, REVIEW_GROUP_IDS.allowedVendors),
|
|
71
|
-
},
|
|
72
|
-
applyToCards: draft.cardSelections
|
|
73
|
-
.filter((card) => card.isChecked)
|
|
74
|
-
.map((card) => card.id),
|
|
75
|
-
blockedEntity: {
|
|
76
|
-
categoryCodes: collectCategoryCodesFromReviewRow(row, REVIEW_GROUP_IDS.restrictedCategories),
|
|
77
|
-
merchantNames: collectVendorLabelsFromReviewRow(row, REVIEW_GROUP_IDS.blockedVendors),
|
|
78
|
-
},
|
|
79
|
-
description: description.trim(),
|
|
80
|
-
name: row.name.trim(),
|
|
81
|
-
requiredReceiptThreshold: limitValueFromReviewRow(row, REVIEW_LIMIT_CHIP_IDS.receipt),
|
|
82
|
-
spendLimits: {
|
|
83
|
-
transaction: limitValueFromReviewRow(row, REVIEW_LIMIT_CHIP_IDS.transaction),
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
// One entry per checked review row; per-mode key contract enforced internally.
|
|
87
|
-
export const toBulkCardPolicyTemplateRequestsFromDraft = ({ draft, description = '', guidedMode = 'strict', }) => {
|
|
88
|
-
const checkedRows = draft.policiesReview.filter((row) => row.isChecked);
|
|
89
|
-
if (draft.policyKind === 'guided') {
|
|
90
|
-
return checkedRows.map((row) => buildGuidedEntry(row, draft, guidedMode, description));
|
|
91
|
-
}
|
|
92
|
-
if (draft.policyKind === 'upload') {
|
|
93
|
-
return checkedRows.map((row) => buildUploadEntry(row, draft, description));
|
|
94
|
-
}
|
|
95
|
-
return checkedRows.map((row) => buildAutoEntry(row, description));
|
|
96
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION, } from './cardPolicyFormDraftTypes';
|
|
2
|
-
import { amountFromLimitRow, collectCategoryCodes, collectMerchantNames, projectAutoReviewRowToCardPolicyRequestParts, } from './cardPolicyRequestParts';
|
|
3
|
-
// auto/upload project from the active review row's chip groups; guided reads source slices.
|
|
4
|
-
// Active row = first checked, else first; name follows the same rule.
|
|
5
|
-
export const toCardPolicyTemplateRequestFromDraft = ({ draft, description = '', mode = 'strict', }) => {
|
|
6
|
-
const name = pickPolicyName(draft);
|
|
7
|
-
const base = {
|
|
8
|
-
description: description.trim(),
|
|
9
|
-
mode,
|
|
10
|
-
name: name.trim(),
|
|
11
|
-
};
|
|
12
|
-
if (draft.policyKind === 'auto' || draft.policyKind === 'upload') {
|
|
13
|
-
const activeRow = draft.policiesReview.find((row) => row.isChecked) ??
|
|
14
|
-
draft.policiesReview[0];
|
|
15
|
-
if (activeRow == null) {
|
|
16
|
-
return {
|
|
17
|
-
...base,
|
|
18
|
-
allowedEntity: { categoryCodes: [], merchantNames: [] },
|
|
19
|
-
applyToCards: [],
|
|
20
|
-
blockedEntity: { categoryCodes: [], merchantNames: [] },
|
|
21
|
-
requiredReceiptThreshold: null,
|
|
22
|
-
spendLimits: { transaction: null },
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
...base,
|
|
27
|
-
...projectAutoReviewRowToCardPolicyRequestParts(activeRow),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
// Guided
|
|
31
|
-
return {
|
|
32
|
-
...base,
|
|
33
|
-
allowedEntity: {
|
|
34
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'allow'),
|
|
35
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'allow'),
|
|
36
|
-
},
|
|
37
|
-
applyToCards: draft.cardSelections
|
|
38
|
-
.filter((row) => row.isChecked)
|
|
39
|
-
.map((row) => row.id),
|
|
40
|
-
blockedEntity: {
|
|
41
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'block'),
|
|
42
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'block'),
|
|
43
|
-
},
|
|
44
|
-
requiredReceiptThreshold: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT),
|
|
45
|
-
spendLimits: {
|
|
46
|
-
transaction: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION),
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
const pickPolicyName = (draft) => {
|
|
51
|
-
const checked = draft.policiesReview.find((row) => row.isChecked);
|
|
52
|
-
if (checked != null) {
|
|
53
|
-
return checked.name;
|
|
54
|
-
}
|
|
55
|
-
if (draft.policiesReview.length > 0) {
|
|
56
|
-
return draft.policiesReview[0].name;
|
|
57
|
-
}
|
|
58
|
-
return '';
|
|
59
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION, } from './cardPolicyFormDraftTypes';
|
|
2
|
-
import { amountFromLimitRow, collectCategoryCodes, collectMerchantNames, } from './cardPolicyRequestParts';
|
|
3
|
-
// Mirrors the AI guided builder without the `policiesReview` projection;
|
|
4
|
-
// disabled limit toggles emit `null` (BE: "not configured").
|
|
5
|
-
export const toManualCardPolicyTemplateRequestFromDraft = (draft) => ({
|
|
6
|
-
allowedEntity: {
|
|
7
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'allow'),
|
|
8
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'allow'),
|
|
9
|
-
},
|
|
10
|
-
applyToCards: draft.cardSelections
|
|
11
|
-
.filter((row) => row.isChecked)
|
|
12
|
-
.map((row) => row.id),
|
|
13
|
-
blockedEntity: {
|
|
14
|
-
categoryCodes: collectCategoryCodes(draft.categoryPolicy, 'block'),
|
|
15
|
-
merchantNames: collectMerchantNames(draft.vendorPolicy, 'block'),
|
|
16
|
-
},
|
|
17
|
-
description: draft.description.trim(),
|
|
18
|
-
mode: draft.mode,
|
|
19
|
-
name: draft.name.trim(),
|
|
20
|
-
requiredReceiptThreshold: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT),
|
|
21
|
-
spendLimits: {
|
|
22
|
-
transaction: amountFromLimitRow(draft.limits, CARD_POLICY_LIMIT_ROW_ID_TRANSACTION),
|
|
23
|
-
},
|
|
24
|
-
});
|
package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { deriveAiCardRowsFromTeams } from './deriveAiCardRowsFromTeams';
|
|
2
|
-
// Re-derives step-2 `cardRows` only when step-1 team selection changed.
|
|
3
|
-
// Step-2-only edits must skip the re-derive: `deriveAiCardRowsFromTeams` keys
|
|
4
|
-
// off `cardRow.id`, and a dropdown swap has just mutated it — re-running would
|
|
5
|
-
// revert the edit to the source team's id/label.
|
|
6
|
-
export const applyAiCardCreationFormDraftUpdate = ({ next, prev, context, }) => {
|
|
7
|
-
if (context == null || context.mode === 'create') {
|
|
8
|
-
return next;
|
|
9
|
-
}
|
|
10
|
-
if (!haveCheckedTeamRowsChanged(prev?.teamRows, next.teamRows)) {
|
|
11
|
-
return next;
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
teamRows: next.teamRows,
|
|
15
|
-
cardRows: deriveAiCardRowsFromTeams({
|
|
16
|
-
teamRows: next.teamRows,
|
|
17
|
-
prevCardRows: next.cardRows,
|
|
18
|
-
allUsers: context.allUsers,
|
|
19
|
-
suggestedOwnerUserIdByTeamId: context.suggestedOwnerUserIdByTeamId,
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const haveCheckedTeamRowsChanged = (prevTeamRows, nextTeamRows) => {
|
|
24
|
-
const prevCheckedIds = (prevTeamRows ?? [])
|
|
25
|
-
.filter((row) => row.isChecked)
|
|
26
|
-
.map((row) => row.id);
|
|
27
|
-
const nextCheckedIds = nextTeamRows
|
|
28
|
-
.filter((row) => row.isChecked)
|
|
29
|
-
.map((row) => row.id);
|
|
30
|
-
if (prevCheckedIds.length !== nextCheckedIds.length) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return prevCheckedIds.some((id, idx) => id !== nextCheckedIds[idx]);
|
|
34
|
-
};
|
package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { deriveAiCardRowsFromTeams } from './deriveAiCardRowsFromTeams';
|
|
2
|
-
// Branches on `initialData.mode`:
|
|
3
|
-
// - review: step-1 teams start checked; step-2 `cardRows` pre-derived so the
|
|
4
|
-
// happy path (no toggle) lands on a populated table.
|
|
5
|
-
// - create: seed `cardRows` from AI's suggested cards; `teamRows` stays empty.
|
|
6
|
-
export const buildAiCardCreationFormDraftSeed = ({ initialData, allUsers, }) => {
|
|
7
|
-
const context = {
|
|
8
|
-
allUsers,
|
|
9
|
-
mode: initialData.mode,
|
|
10
|
-
suggestedOwnerUserIdByTeamId: initialData.suggestedOwnerUserIdByTeamId,
|
|
11
|
-
};
|
|
12
|
-
if (initialData.mode === 'create') {
|
|
13
|
-
return {
|
|
14
|
-
context,
|
|
15
|
-
draft: {
|
|
16
|
-
teamRows: [],
|
|
17
|
-
cardRows: initialData.cardRows.map((seed) => buildCardRowFromSeed(seed, allUsers)),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const teamRows = initialData.teamRows.map((row) => ({
|
|
22
|
-
cardKind: row.cardKind,
|
|
23
|
-
id: row.id,
|
|
24
|
-
isChecked: true,
|
|
25
|
-
label: row.label,
|
|
26
|
-
value: row.avgMonthlySpend,
|
|
27
|
-
rightLabel: row.recommendedLimit,
|
|
28
|
-
rightSubLabel: row.recommendedLimitCadence,
|
|
29
|
-
}));
|
|
30
|
-
return {
|
|
31
|
-
context,
|
|
32
|
-
draft: {
|
|
33
|
-
teamRows,
|
|
34
|
-
cardRows: deriveAiCardRowsFromTeams({
|
|
35
|
-
teamRows,
|
|
36
|
-
prevCardRows: [],
|
|
37
|
-
allUsers,
|
|
38
|
-
suggestedOwnerUserIdByTeamId: initialData.suggestedOwnerUserIdByTeamId,
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const buildCardRowFromSeed = (seed, allUsers) => {
|
|
44
|
-
const selectedUser = seed.suggestedOwnerUserId != null
|
|
45
|
-
? allUsers.find((user) => user.userId === seed.suggestedOwnerUserId)
|
|
46
|
-
: undefined;
|
|
47
|
-
return {
|
|
48
|
-
cardKind: seed.cardKind,
|
|
49
|
-
id: seed.id,
|
|
50
|
-
label: seed.label,
|
|
51
|
-
owner: {
|
|
52
|
-
allUsers,
|
|
53
|
-
selectedUser,
|
|
54
|
-
},
|
|
55
|
-
recommendedLimit: seed.recommendedLimit,
|
|
56
|
-
};
|
|
57
|
-
};
|
package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// One row per checked team in source order. Existing rows are preserved
|
|
2
|
-
// verbatim so step-2 user edits survive upstream re-derives; new teams seed
|
|
3
|
-
// owner from the suggestion map and `recommendedLimit` by parsing `rightLabel`.
|
|
4
|
-
export const deriveAiCardRowsFromTeams = ({ teamRows, prevCardRows = [], allUsers, suggestedOwnerUserIdByTeamId, }) => {
|
|
5
|
-
const prevById = new Map(prevCardRows.map((row) => [row.id, row]));
|
|
6
|
-
const userById = new Map(allUsers.map((user) => [user.userId, user]));
|
|
7
|
-
return teamRows
|
|
8
|
-
.filter((row) => row.isChecked)
|
|
9
|
-
.map((teamRow) => {
|
|
10
|
-
const previous = prevById.get(teamRow.id);
|
|
11
|
-
if (previous != null) {
|
|
12
|
-
return previous;
|
|
13
|
-
}
|
|
14
|
-
const suggestedUserId = suggestedOwnerUserIdByTeamId[teamRow.id];
|
|
15
|
-
const selectedUser = suggestedUserId != null ? userById.get(suggestedUserId) : undefined;
|
|
16
|
-
return {
|
|
17
|
-
cardKind: teamRow.cardKind,
|
|
18
|
-
id: teamRow.id,
|
|
19
|
-
label: teamRow.label,
|
|
20
|
-
owner: {
|
|
21
|
-
allUsers,
|
|
22
|
-
selectedUser,
|
|
23
|
-
},
|
|
24
|
-
recommendedLimit: parseLimitToFloat(teamRow.rightLabel),
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
const parseLimitToFloat = (raw) => {
|
|
29
|
-
const cleaned = raw.replace(/[^0-9.-]/g, '');
|
|
30
|
-
if (cleaned.length === 0) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
const parsed = Number(cleaned);
|
|
34
|
-
return Number.isFinite(parsed) ? parsed : undefined;
|
|
35
|
-
};
|
package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { EMPTY, concat, of } from 'rxjs';
|
|
2
|
-
import { distinctUntilChanged, filter, map, mergeMap, take, } from 'rxjs/operators';
|
|
3
|
-
import { upsertAnswerPayload, upsertOrAddQuestionAnswerPayload, } from '../../../../entity/aiCfo/aiCfoReducer';
|
|
4
|
-
import { getQuestionAnswerByIdForChatSession } from '../../../../entity/aiCfo/aiCfoSelector';
|
|
5
|
-
import { fetchUserListByType } from '../../../userListView/userListViewReducer';
|
|
6
|
-
import { getUserList } from '../../../userListView/userListViewSelector';
|
|
7
|
-
import { clearAiCardCreationFormDraft, issueChargeCardSuccessOrFailure, seedAiCardCreationFormDraft, } from './issueChargeCardReducer';
|
|
8
|
-
const readAllUsersAsUserArray = (state) => getUserList(state.userState, state.userRoleState, state.userListViewState, 'cardHolderCandidate')
|
|
9
|
-
.users.map((person) => person.user)
|
|
10
|
-
.filter((user) => user != null);
|
|
11
|
-
const readCardsCreationPayload = (state, chatSessionId, questionAnswerId) => {
|
|
12
|
-
const qa = getQuestionAnswerByIdForChatSession(state.aiCfoState, chatSessionId, questionAnswerId);
|
|
13
|
-
const visualization = qa?.responses.answer?.content.visualization;
|
|
14
|
-
if (visualization?.type !== 'interactive_form') {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
const data = visualization.data;
|
|
18
|
-
if (!('formType' in data) || data.formType !== 'cards_creation') {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return data.payload;
|
|
22
|
-
};
|
|
23
|
-
// Pusher may target "latest QA"; REST always carries the id. Either way,
|
|
24
|
-
// resolve to the QA the reducer just wrote so we can read it off state.
|
|
25
|
-
const resolveQuestionAnswerId = (state, action) => {
|
|
26
|
-
if (action.payload.questionAnswerId != null) {
|
|
27
|
-
return action.payload.questionAnswerId;
|
|
28
|
-
}
|
|
29
|
-
const session = state.aiCfoState.aiCfoByChatSessionId[action.payload.chatSessionId];
|
|
30
|
-
return session?.questionAnswers.slice(-1)[0]?.questionAnswerId;
|
|
31
|
-
};
|
|
32
|
-
const isSeedTrigger = (action) => upsertAnswerPayload.match(action) ||
|
|
33
|
-
upsertOrAddQuestionAnswerPayload.match(action);
|
|
34
|
-
export const seedAiCardCreationFormDraftEpic = (actions$, state$) => actions$.pipe(mergeMap((action) => {
|
|
35
|
-
if (issueChargeCardSuccessOrFailure.match(action) &&
|
|
36
|
-
action.payload.fetchState === 'Completed') {
|
|
37
|
-
return of(clearAiCardCreationFormDraft());
|
|
38
|
-
}
|
|
39
|
-
if (!isSeedTrigger(action)) {
|
|
40
|
-
return EMPTY;
|
|
41
|
-
}
|
|
42
|
-
const state = state$.value;
|
|
43
|
-
const questionAnswerId = resolveQuestionAnswerId(state, action);
|
|
44
|
-
if (questionAnswerId == null) {
|
|
45
|
-
return EMPTY;
|
|
46
|
-
}
|
|
47
|
-
const payload = readCardsCreationPayload(state, action.payload.chatSessionId, questionAnswerId);
|
|
48
|
-
if (payload == null) {
|
|
49
|
-
return EMPTY;
|
|
50
|
-
}
|
|
51
|
-
const allUsersNow = readAllUsersAsUserArray(state);
|
|
52
|
-
if (allUsersNow.length > 0) {
|
|
53
|
-
return of(seedAiCardCreationFormDraft(allUsersNow, payload));
|
|
54
|
-
}
|
|
55
|
-
const seedWhenUsersLoaded$ = state$.pipe(map(readAllUsersAsUserArray), distinctUntilChanged((prev, next) => prev.length === next.length &&
|
|
56
|
-
prev.every((user, idx) => user === next[idx])), filter((users) => users.length > 0), take(1), map((users) => seedAiCardCreationFormDraft(users, payload)));
|
|
57
|
-
const userListFetchState = state.userListViewState.userListByType.cardHolderCandidate.fetchState;
|
|
58
|
-
if (userListFetchState === 'In-Progress') {
|
|
59
|
-
return seedWhenUsersLoaded$;
|
|
60
|
-
}
|
|
61
|
-
return concat(of(fetchUserListByType('cardHolderCandidate', false)), seedWhenUsersLoaded$);
|
|
62
|
-
}));
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// V1: AI CFO only issues monthly business_virtual_credit_cards. Form has no
|
|
2
|
-
// frequency field; the unused physicalCard/debitCard slots are filled with
|
|
3
|
-
// empty defaults the epic ignores.
|
|
4
|
-
const DEFAULT_FREQUENCY = 'monthly';
|
|
5
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
6
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
7
|
-
const mapCardRow = (row) => {
|
|
8
|
-
const ownerUserId = row.owner.selectedUser?.userId;
|
|
9
|
-
return {
|
|
10
|
-
lineId: row.id,
|
|
11
|
-
chargeCardType: 'credit_card',
|
|
12
|
-
creditCard: {
|
|
13
|
-
cardType: 'business_virtual_credit_card',
|
|
14
|
-
virtualCard: {
|
|
15
|
-
cardName: row.label,
|
|
16
|
-
frequency: DEFAULT_FREQUENCY,
|
|
17
|
-
userIds: ownerUserId != null ? [ownerUserId] : [],
|
|
18
|
-
amount: {
|
|
19
|
-
amount: row.recommendedLimit ?? 0,
|
|
20
|
-
currencyCode: DEFAULT_CURRENCY_CODE,
|
|
21
|
-
currencySymbol: DEFAULT_CURRENCY_SYMBOL,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
physicalCard: {
|
|
25
|
-
cardName: '',
|
|
26
|
-
frequency: DEFAULT_FREQUENCY,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
debitCard: {
|
|
30
|
-
cardType: 'business_virtual_debit_card',
|
|
31
|
-
virtualCard: {
|
|
32
|
-
cardName: '',
|
|
33
|
-
frequency: DEFAULT_FREQUENCY,
|
|
34
|
-
userIds: [],
|
|
35
|
-
},
|
|
36
|
-
physicalCard: {
|
|
37
|
-
cardName: '',
|
|
38
|
-
frequency: DEFAULT_FREQUENCY,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
// Returns [] when `cardRows` is empty so callers can short-circuit submission.
|
|
44
|
-
export const toIssueChargeCardLocalDataFromDraft = (draft) => draft.cardRows.map(mapCardRow);
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessResponse } from '../../../../../responsePayload';
|
|
4
|
-
import { applyKybDocumentAutofillForOnboarding } from '../../../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
5
|
-
import { parseUploadedKybDocument, parseUploadedKybDocumentFailure, } from '../../kycKybAutofillActions';
|
|
6
|
-
import { mapCoiToCompanyDetails, mapTaxEinToCompanyDetails, } from '../../kycKybParseMapper';
|
|
7
|
-
import { applyKybDocumentAutofillForSetup } from '../../setupViewReducer';
|
|
8
|
-
const PROCESS_DOCUMENT_SYNC_PATH = '/1.0/documents/process/sync';
|
|
9
|
-
export const parseUploadedKybDocumentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(parseUploadedKybDocument.match), mergeMap((action) => {
|
|
10
|
-
const { target, companyId, fileId, documentType } = action.payload;
|
|
11
|
-
const url = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}${PROCESS_DOCUMENT_SYNC_PATH}`;
|
|
12
|
-
const requestPayload = {
|
|
13
|
-
provided_document_type: documentType,
|
|
14
|
-
files: [{ file_id: fileId }],
|
|
15
|
-
processing_priority: 10,
|
|
16
|
-
metadata: { source: 'kyc_kyb_autofill' },
|
|
17
|
-
};
|
|
18
|
-
const failureAction = parseUploadedKybDocumentFailure({ target, fileId });
|
|
19
|
-
return zeniAPI
|
|
20
|
-
.postAndGetJSON(url, requestPayload)
|
|
21
|
-
.pipe(mergeMap((response) => {
|
|
22
|
-
if (!isSuccessResponse(response) || response.data == null) {
|
|
23
|
-
return of(failureAction);
|
|
24
|
-
}
|
|
25
|
-
// Sync API returns a batch envelope: `data.files[0].extracted_data`
|
|
26
|
-
// is the parser payload; `data` itself is the request-level wrapper.
|
|
27
|
-
const extracted = response.data.files?.[0]?.extracted_data;
|
|
28
|
-
if (extracted == null) {
|
|
29
|
-
return of(failureAction);
|
|
30
|
-
}
|
|
31
|
-
let result;
|
|
32
|
-
switch (documentType) {
|
|
33
|
-
case 'certificate_of_incorporation':
|
|
34
|
-
result = mapCoiToCompanyDetails(extracted);
|
|
35
|
-
break;
|
|
36
|
-
case 'tax_ein':
|
|
37
|
-
result = mapTaxEinToCompanyDetails(extracted);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
41
|
-
return of(failureAction);
|
|
42
|
-
}
|
|
43
|
-
const applyAction = target === 'setup'
|
|
44
|
-
? applyKybDocumentAutofillForSetup({
|
|
45
|
-
companyId,
|
|
46
|
-
fileId,
|
|
47
|
-
values: result.values,
|
|
48
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
49
|
-
})
|
|
50
|
-
: applyKybDocumentAutofillForOnboarding({
|
|
51
|
-
companyId,
|
|
52
|
-
fileId,
|
|
53
|
-
values: result.values,
|
|
54
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
55
|
-
});
|
|
56
|
-
return of(applyAction);
|
|
57
|
-
}), catchError(() => of(failureAction)));
|
|
58
|
-
}));
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessResponse } from '../../../../../responsePayload';
|
|
4
|
-
import { newAddressInLocalStore } from '../../../../addressView/addressViewReducer';
|
|
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
|
-
let result;
|
|
35
|
-
switch (documentType) {
|
|
36
|
-
case 'passport':
|
|
37
|
-
result = mapPassportToOfficer(extracted);
|
|
38
|
-
break;
|
|
39
|
-
case 'driving_license':
|
|
40
|
-
result = mapDrivingLicenseToOfficer(extracted);
|
|
41
|
-
break;
|
|
42
|
-
case 'social_security_card':
|
|
43
|
-
result = mapSsnCardToOfficer(extracted);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
if (result.autoFilledFieldNames.length === 0) {
|
|
47
|
-
return of(failureAction);
|
|
48
|
-
}
|
|
49
|
-
const applyAction = target === 'setup'
|
|
50
|
-
? applyKycDocumentAutofillForSetup({
|
|
51
|
-
companyId,
|
|
52
|
-
officerType,
|
|
53
|
-
fileId,
|
|
54
|
-
values: result.values,
|
|
55
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
56
|
-
})
|
|
57
|
-
: applyKycDocumentAutofillForOnboarding({
|
|
58
|
-
companyId,
|
|
59
|
-
officerType,
|
|
60
|
-
fileId,
|
|
61
|
-
values: result.values,
|
|
62
|
-
autoFilledFieldNames: result.autoFilledFieldNames,
|
|
63
|
-
});
|
|
64
|
-
const actions = [applyAction];
|
|
65
|
-
// Driving licenses also carry the home address, which lives in the
|
|
66
|
-
// addressView slice (keyed `officer_<n>_address`). Seed it so the
|
|
67
|
-
// section's address field + ✦ badge pick it up.
|
|
68
|
-
if (result.address != null) {
|
|
69
|
-
const addressType = `${officerType.toLowerCase()}_address`;
|
|
70
|
-
actions.push(newAddressInLocalStore({
|
|
71
|
-
addressType,
|
|
72
|
-
addressToCreate: result.address,
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
return from(actions);
|
|
76
|
-
}), catchError(() => of(failureAction)));
|
|
77
|
-
}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trigger actions for the KYC / KYB autofill epics.
|
|
3
|
-
*
|
|
4
|
-
* These actions don't mutate state — the epic listens for them, calls
|
|
5
|
-
* document-communication-agent's sync endpoint, and dispatches the appropriate
|
|
6
|
-
* `applyKyc/KybDocumentAutofillFor{Setup,Onboarding}` against the matching
|
|
7
|
-
* slice. Co-located with the rest of the commonSetup module because the entire
|
|
8
|
-
* autofill flow is auxiliary to the setup view; there is no separate state.
|
|
9
|
-
*/
|
|
10
|
-
import { 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');
|