@zeniai/client-epic-state 4.11.3 → 4.11.5
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/entity/cardPayment/cardPaymentPayload.d.ts +26 -0
- package/lib/entity/cardPayment/cardPaymentPayload.js +28 -0
- package/lib/entity/cardPayment/cardPaymentReducer.d.ts +11 -0
- package/lib/entity/cardPayment/cardPaymentReducer.js +59 -0
- package/lib/entity/cardPayment/cardPaymentSelector.d.ts +6 -0
- package/lib/entity/cardPayment/cardPaymentSelector.js +27 -0
- package/lib/entity/cardPayment/cardPaymentState.d.ts +28 -0
- package/lib/entity/cardPayment/cardPaymentState.js +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +7 -2
- package/lib/index.js +18 -9
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/cardPayment/cardPaymentViewPayload.d.ts +37 -0
- package/lib/view/cardPayment/cardPaymentViewPayload.js +2 -0
- package/lib/view/cardPayment/cardPaymentViewReducer.d.ts +32 -0
- package/lib/view/cardPayment/cardPaymentViewReducer.js +125 -0
- package/lib/view/cardPayment/cardPaymentViewSelector.d.ts +16 -0
- package/lib/view/cardPayment/cardPaymentViewSelector.js +24 -0
- package/lib/view/cardPayment/cardPaymentViewState.d.ts +19 -0
- package/lib/view/cardPayment/cardPaymentViewState.js +2 -0
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +34 -0
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.js +76 -0
- package/lib/view/cardPayment/epic/confirmCardSetupEpic.d.ts +25 -0
- package/lib/view/cardPayment/epic/confirmCardSetupEpic.js +50 -0
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +27 -0
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.js +62 -0
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +31 -0
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.js +69 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +1 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +6 -14
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +1 -0
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -0
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +5 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +4 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +13 -6
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewReducer.js +9 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.d.ts +2 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewState.d.ts +4 -0
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/package.json +2 -1
package/lib/index.js
CHANGED
|
@@ -39,15 +39,15 @@ exports.toSubscriptionSortKeyType = exports.getBankAccount = exports.getNestedAc
|
|
|
39
39
|
exports.getAttachmentFileIdByFileName = exports.mapAttachmentFileToAttachmentFilePayload = exports.mapAttachmentFilePayloadToFile = exports.mapFilePayloadToFile = exports.uploadFile = exports.getFileDeleteStatusById = exports.getFileUpdateNameStatusById = exports.getDeleteFileListWithStatus = exports.getFileListWithStatus = exports.clearFileViewList = exports.deleteFileSuccess = exports.deleteFileFailure = exports.deleteFile = exports.deleteFileListSuccess = exports.deleteFileListFailure = exports.deleteFileList = exports.updateFilesMetadata = exports.updateFileNameSuccess = exports.updateFileNameFailure = exports.updateFileName = exports.fetchFile = exports.fetchFileListSuccess = exports.fetchFileListFailure = exports.fetchFileList = exports.toSupportedAttachmentFileType = exports.toSupportedAttachmentFileFormatType = exports.toSupportedFileTypeStrict = exports.removeAttachmentFiles = exports.updateAttachmentFiles = exports.updateFiles = exports.SUPPORTED_ATTACHMENT_FILE_TYPES = exports.getSubscriptionEstimationData = exports.getSubscriptionLocalStoreDataView = exports.getSubscriptionsDetailView = exports.clearSubscriptionLocalData = exports.clearSubscriptionUpdateViewDataByTenantId = exports.saveSubscriptionLocalData = exports.initializeSubscriptionLocalData = exports.clearSubscriptionView = exports.fetchSubscriptionUpdateEstimate = exports.fetchSubscriptionCreateEstimate = exports.saveSubscriptionNotesUpdates = exports.saveSubscriptionUpdates = exports.fetchSubscriptionDetails = exports.fetchSubscriptionCoupons = exports.fetchSubscriptionAddOns = exports.fetchSubscriptionPlans = exports.fetchSubscriptionList = exports.updateCompanySubscriptionUIState = exports.getCompanySubscriptionView = void 0;
|
|
40
40
|
exports.updateRemiListSubTab = exports.updateRemiListTab = exports.fetchRemiListPerTab = exports.fetchRemiList = exports.getRemiDownloadList = exports.getRemiList = exports.toRemiTabTypeStrict = exports.toRemiTabType = exports.toRemiSubTabTypeStrict = exports.toRemiSubTabType = exports.deleteUserBankAccount = exports.createUserBankAccount = exports.resetCreateBankAccountDetails = exports.createInternationalBankAccount = exports.createBankAccount = exports.deleteBankAccount = exports.fetchBankCountryNameByIban = exports.fetchBankNameBySwift = exports.fetchBankNameByRouting = exports.fetchVendorDetailPageView = exports.fetchVendorDetails = exports.updateStatusForCreateBankAccountFlow = exports.clearBankAccountView = exports.updateInternationalBankAccountViewLocalStoreData = exports.updateBankAccountViewLocalStoreData = exports.initializeVendorAddress = exports.updateSelectedVendorForCreateFlow = exports.removeBankAccountsInVendorView = exports.saveVendor = exports.fetchVendor = exports.updateScrollYOffset = exports.fetchVendorsList = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.getVendorsTabDetailPageView = exports.toVendorDetailTabsType = exports.getVendorAllTransactionsDefaultTimePeriod = exports.resetVendorsTabVendorAllTransactionsTabData = exports.resetSelectedTabType = exports.updateVendorsTabVendorAllTransactionsTabData = exports.updateVendorSpendTrendFilterTabValue = exports.updateSelectedTabType = exports.fetchVendorsTabVendorDetailPageView = exports.getVendorDetailPageView = exports.getVendorView = exports.getAnalyticsDataOnVendorSave = exports.fetchTasksCard = exports.downloadFile = void 0;
|
|
41
41
|
exports.toPaymentToOption = exports.updateVendorContact = exports.verifyUser = exports.fetchUserDetails = exports.updateBillListSearchResult = exports.updateBillUploadFetchState = exports.updateContactsInVendorDetailLocalData = exports.resetVendorDetailLocalData = exports.updateVendorDetailLocalData = exports.BILL_PAY_FILTER_CATEGORIES = exports.updateBillListUIState = exports.saveVendorSuccessOrFailure = exports.updateShowAutofill = exports.fetchBillAndInitializeLocalStore = exports.getReviewPageBillDetail = exports.getEditBillDetail = exports.clearBillPayReview = exports.fetchDuplicateBill = exports.fetchAndUpdateVendorRecommendations = exports.fetchEditBillDetailPage = exports.fetchBillDetail = exports.getBillTransactionDetailKey = exports.checkApproveRejectBtnShowForBill = exports.getBillDetailView = exports.getBillDownloadList = exports.getBillList = exports.cancelAndDeleteBill = exports.deleteBill = exports.updateApprovalStatusOnSuccess = exports.approveOrRejectBill = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.updateBillDetailSaveBillCode = exports.updateSelectedBillId = exports.updateSubTab = exports.updateTab = exports.fetchBillListPerTab = exports.fetchBillList = exports.getClassList = exports.updateBillListDownloadUIState = exports.updateRemiListDownloadUIState = exports.REIMBURSEMENT_FILTER_CATEGORIES_RESTRICTED = exports.REIMBURSEMENT_FILTER_CATEGORIES = exports.updateRemiListFilterResult = exports.updateBillListFilterResult = exports.updateRemiListSearchResult = exports.updateRemiListUIState = exports.updateRemiDetailSaveRemiCode = void 0;
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.getCompanyTaskManagerView = exports.fetchCompanyTaskManagerView = exports.getMinAllowedEndDate = exports.toRecurringFrequency = exports.getRecurringEndDateFromCount = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.getNotifications = exports.getLastNotificationTime = exports.pushToastNotification = exports.getNotificationsForSelectedSubTab = exports.getExternalNotificationsForSelectedSubTab = exports.getNotificationView = exports.updateNotificationViewUIState = exports.updateNotificationViewSubTab = exports.updateNotificationViewCurrentTabAndSubTab = exports.updateNotificationViewTabState = exports.updateNotificationViewNotificationStatus = exports.updateNotificationViewAllNotificationsStatus = exports.fetchNotificationUnreadCountSuccess = exports.fetchNotificationUnreadCount = exports.fetchNotificationView = exports.toNotificationTabTypeStrict = exports.toNotificationSubTabTypeStrict = exports.updateCommentsNotificationsStatuses = exports.updateCommentsNotifications = exports.toNotificationModeStrict = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = void 0;
|
|
42
|
+
exports.getRemiSetupViewDetails = exports.clearRemiSetupView = exports.acceptEmployeeRemiTerms = exports.acceptRemiTerms = exports.saveRemiSetupViewDataInLocalStore = exports.updateMileageDetails = exports.fetchRemiSetupView = exports.getUserFinancialAccount = exports.fetchUserFinancialAccount = exports.getIntegrationsView = exports.getBankConnectionsSetupViewDetails = exports.getApprovalRuleViewDetails = exports.getCommonSetupViewDetails = exports.getZeniAccountBusinessVerificationDetails = exports.getBillPayBusinessVerificationDetails = exports.getBusinessVerificationDetails = exports.getZeniAccountSetupViewDetails = exports.getPlaidAccountDetails = exports.getBillPaySetupViewDetails = exports.verifyOtp = exports.resendOtp = exports.sendOtp = exports.updateZeniAccountSetupViewUIState = exports.clearZeniAccountSetupView = exports.clearBillPaySetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.acceptBillPayUpdatedTerms = exports.acceptZeniAccountTerms = exports.acceptBillPayTerms = exports.updatePrimaryFundingAccount = exports.updateMappedCashAccount = exports.establishPlaidConnection = exports.updatePaymentAccountStatus = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccount = exports.updateBusinessVerificationDetails = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.getPlaidLinkToken = exports.getPaymentAccounts = exports.enableSetup = exports.fetchZeniAccountSetupView = exports.fetchBillPaySetupView = exports.hideCreatedByFilter = exports.fetchVendorAndUpdateBillLocalData = exports.convertAmountToHomeCurrency = void 0;
|
|
43
|
+
exports.saveRemiSuccessOrFailure = exports.saveRemiDetail = exports.removeFileFromRemiUpdatesInLocalStore = exports.discardRemiUpdatesInLocalStore = exports.fetchCurrencyConversionValue = exports.saveRemiUpdatesToLocalStore = exports.initializeRemiToLocalStore = exports.fetchRemiAndInitializeLocalStore = exports.fetchRecommendationsAndUpdateMerchantRecommendations = exports.fetchEditRemiDetailPage = exports.getEditRemiDetail = exports.removeDuplicateReimbursementByLineId = exports.clearDuplicateReimbursementDetail = exports.fetchDuplicateReimbursement = exports.clearRemiDetailView = exports.approveOrRejectRemi = exports.cancelAndDeleteRemi = exports.fetchRemiDetail = exports.deleteRemi = exports.updateIsEditModeRealTimeApprovals = exports.saveRealTimeApproval = exports.checkApproveRejectBtnShowForRemi = exports.getRemiDetailView = exports.clearRemiSetupApproverView = exports.clearRemiSetupApproverViewUpdateData = exports.initializeRemiSetupApproverViewUpdateData = exports.saveRemiSetupApproverViewUpdates = exports.saveRemiSetupApproverViewUpdateData = exports.deleteRemiApprovalRule = exports.fetchRemiApproversDetails = exports.fetchRemiApproversList = exports.fetchRemiSetupApproverView = exports.getRemiSetupApproverUpdateDataView = exports.getRemiSetupApproverView = exports.clearBillPaySetupApproverView = exports.clearBillPaySetupApproverViewUpdateData = exports.initializeBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdates = exports.saveBillPaySetupApproverViewUpdateData = exports.deleteBillPayApprovalRule = exports.fetchBillPayApproversList = exports.fetchBillPayApproversDetails = exports.fetchBillPaySetupApproverView = exports.getBillPaySetupApproverUpdateDataView = exports.getBillPaySetupApproverView = exports.toRoleTypeStrict = exports.toAttributeOrRoleTypeStrict = exports.toAttributeTypeStrict = exports.isSuccessResponse = exports.getRemiBusinessVerificationDetails = void 0;
|
|
44
|
+
exports.getSnackbar = exports.closeSnackbar = exports.openSnackbar = exports.getChangedLineItemCountFromLocalData = exports.getTransactionListUIStateByCategoryType = exports.getTransactionsListByCategoryType = exports.retryBankAccountConnectionForOnboarding = exports.sendOnboardingCustomerViewInvite = exports.resetNewOnboardedCustomerId = exports.updateOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerNotes = exports.saveOnboardingCustomerViewUpdates = exports.updateStatusAfterOnboardingCompleted = exports.updateCustomerCreationStatus = exports.updateOnboardingCustomerListUIState = exports.saveOnboardingCustomerViewUpdateData = exports.clearOnboardingCustomerViewUpdateData = exports.initializeOnboardingCustomerViewUpdateData = exports.getOnboardingEmailGroup = exports.getNewOnboardingCustomerView = exports.getOnboardingCockpitView = exports.toProductTypeStrict = exports.toProductType = exports.saveOnboardingCustomerCompletedStatus = exports.fetchOnboardingCompletedCompanies = exports.fetchCompanyOnboardingView = exports.PAYMENT_BUSINESS_DAYS = exports.holidaysFormatted = exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.toFileTypeStrict = exports.ALL_FILE_TYPES = exports.isAllFetchCompleted = exports.isAnyFetchInProgress = exports.reduceAnyCompletedFetchState = exports.reduceAllFetchState = exports.reduceAnyFetchState = exports.reduceFetchState = exports.clearAddRemiAutoFields = exports.clearTentativeMerchantName = exports.updateTentativeMerchantNames = exports.updateUploadFetchState = exports.updateAddRemiAutoFields = exports.clearEditRemiViewDetail = exports.parseReceiptsToRemi = void 0;
|
|
45
|
+
exports.getCheckDepositDetail = exports.clearCheckDeposit = exports.updateCheckDepositLocalData = exports.depositCheck = exports.ZENI_ACCOUNTS_TAB = exports.fetchDepositAccountDetail = exports.fetchReviewTransferDetail = exports.clearReviewTransferDetail = exports.clearTransferDetail = exports.getTransferDetail = exports.transferMoney = exports.updateDepositToLocalData = exports.updateTransferToLocalData = exports.updateTransferMoneyLocalData = exports.fetchZeniAccountsConfig = exports.fetchDepositAccount = exports.getDepositAccountDetailForPDF = exports.getAllDepostAccounts = exports.getDepositAccountDetail = exports.unlinkPaymentAccount = exports.fetchPaymentAccountList = exports.createCheckingAccount = exports.updateZeniAccountListTab = exports.fetchZeniAccountList = exports.getZeniAccountList = exports.getZeniAccountsConfigDetail = exports.fetchOwnerList = exports.fetchRecommendationByEntityName = exports.fetchRecommendationByEntityId = exports.fetchEntityRecommendationsByTransactionId = exports.toVendorReportIDType = exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.updateYTDSelectionUIState = exports.updatePageToken = exports.updateSortUiState = exports.getVendorList = exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.getInternationalSubConfigCodeKey = exports.shouldEnableCalendarPickerForLastReportSent = exports.canSendMonthEndEmailReport = exports.isVerifiedStatusCode = exports.getActualPaymentDate = exports.showReimbursementPromoPage = exports.showBillPayPromoPage = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = void 0;
|
|
46
|
+
exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLocalStore = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.updateOnboardingCustomerViewUIState = exports.updateCurrentStep = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerView = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingCustomerViewCompleteStatus = exports.updateOnboardingCustomerViewAccountDetails = exports.establishOnboardingPlaidConnection = exports.getOnboardingPlaidLinkToken = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.isZeniClearingAccount = exports.ZENI_CLEARING_ACCOUNT = exports.isZeniClearingAccountReport = exports.getCompanyConfig = exports.fetchCompanyConfig = exports.clearTransactionVendorSaveStatus = exports.resetTransactionVendorLocalData = exports.updateTransactionVendorLocalData = exports.saveTransactionVendorSuccessOrFailure = exports.saveTransactionVendor = exports.getTransactionVendorView = exports.getZeniAccStatements = exports.fetchZeniAccStatementPage = exports.getDepositAccountTransactionList = exports.fetchDepositAccountTransactionList = exports.fetchDepositAccountHistoryFailure = exports.fetchDepositAccountHistorySuccess = exports.updateDepositAccount = void 0;
|
|
47
|
+
exports.fetchApAging = exports.updateChargeCardDetail = exports.updateCashbackDetailUIState = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.resetIssueChargeCardForm = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.acceptChargeCardTerms = exports.fetchChargeCardSetupView = exports.getChargeCardSetupViewDetails = exports.toCreditLimitFrequencyCodeType = exports.getCashbackDetail = exports.toChargeCardSortKeyType = exports.fetchCashbackDetail = exports.fetchChargeCardTransactionList = exports.getChargeCardDetailView = exports.fetchChargeCardDetailPage = exports.getChargeCardListView = exports.fetchChargeCardListPage = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = void 0;
|
|
48
|
+
exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.fetchVendorTabView = exports.resetMarkAsCompleteStatus = exports.markAsCompleteScheduleDetail = exports.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchScheduleList = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = void 0;
|
|
49
|
+
exports.fetchPaymentSources = exports.addCardPaymentSource = exports.confirmCardSetupIntent = exports.createCardSetupIntent = exports.getAllCardsAndBankPaymentMethods = exports.deleteTag = exports.createTag = exports.fetchTagList = exports.getAllTags = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.updateArAgingNodeCollapseState = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = void 0;
|
|
50
|
+
exports.getCompanyTaskManagerView = exports.fetchCompanyTaskManagerView = exports.getMinAllowedEndDate = exports.toRecurringFrequency = exports.getRecurringEndDateFromCount = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.getNotifications = exports.getLastNotificationTime = exports.pushToastNotification = exports.getNotificationsForSelectedSubTab = exports.getExternalNotificationsForSelectedSubTab = exports.getNotificationView = exports.updateNotificationViewUIState = exports.updateNotificationViewSubTab = exports.updateNotificationViewCurrentTabAndSubTab = exports.updateNotificationViewTabState = exports.updateNotificationViewNotificationStatus = exports.updateNotificationViewAllNotificationsStatus = exports.fetchNotificationUnreadCountSuccess = exports.fetchNotificationUnreadCount = exports.fetchNotificationView = exports.toNotificationTabTypeStrict = exports.toNotificationSubTabTypeStrict = exports.updateCommentsNotificationsStatuses = exports.updateCommentsNotifications = exports.toNotificationModeStrict = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.clearCardPaymentView = void 0;
|
|
51
51
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
52
52
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
53
53
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -894,6 +894,7 @@ const zeniAccountSetupViewReducer_1 = require("./view/spendManagement/zeniAccoun
|
|
|
894
894
|
Object.defineProperty(exports, "fetchZeniAccountSetupView", { enumerable: true, get: function () { return zeniAccountSetupViewReducer_1.fetchZeniAccountSetupView; } });
|
|
895
895
|
Object.defineProperty(exports, "acceptZeniAccountTerms", { enumerable: true, get: function () { return zeniAccountSetupViewReducer_1.acceptZeniAccountTerms; } });
|
|
896
896
|
Object.defineProperty(exports, "clearZeniAccountSetupView", { enumerable: true, get: function () { return zeniAccountSetupViewReducer_1.clearZeniAccountSetupView; } });
|
|
897
|
+
Object.defineProperty(exports, "updateZeniAccountSetupViewUIState", { enumerable: true, get: function () { return zeniAccountSetupViewReducer_1.updateZeniAccountSetupViewUIState; } });
|
|
897
898
|
const plaidAccountViewReducer_1 = require("./view/spendManagement/plaidAccount/plaidAccountViewReducer");
|
|
898
899
|
Object.defineProperty(exports, "getPaymentAccounts", { enumerable: true, get: function () { return plaidAccountViewReducer_1.getPaymentAccounts; } });
|
|
899
900
|
Object.defineProperty(exports, "getPlaidLinkToken", { enumerable: true, get: function () { return plaidAccountViewReducer_1.getPlaidLinkToken; } });
|
|
@@ -1398,6 +1399,14 @@ const tagViewReducer_1 = require("./view/tagView/tagViewReducer");
|
|
|
1398
1399
|
Object.defineProperty(exports, "fetchTagList", { enumerable: true, get: function () { return tagViewReducer_1.fetchTagList; } });
|
|
1399
1400
|
Object.defineProperty(exports, "createTag", { enumerable: true, get: function () { return tagViewReducer_1.createTag; } });
|
|
1400
1401
|
Object.defineProperty(exports, "deleteTag", { enumerable: true, get: function () { return tagViewReducer_1.deleteTag; } });
|
|
1402
|
+
const cardPaymentViewSelector_1 = require("./view/cardPayment/cardPaymentViewSelector");
|
|
1403
|
+
Object.defineProperty(exports, "getAllCardsAndBankPaymentMethods", { enumerable: true, get: function () { return cardPaymentViewSelector_1.getAllCardsAndBankPaymentMethods; } });
|
|
1404
|
+
const cardPaymentViewReducer_1 = require("./view/cardPayment/cardPaymentViewReducer");
|
|
1405
|
+
Object.defineProperty(exports, "createCardSetupIntent", { enumerable: true, get: function () { return cardPaymentViewReducer_1.createCardSetupIntent; } });
|
|
1406
|
+
Object.defineProperty(exports, "confirmCardSetupIntent", { enumerable: true, get: function () { return cardPaymentViewReducer_1.confirmCardSetupIntent; } });
|
|
1407
|
+
Object.defineProperty(exports, "addCardPaymentSource", { enumerable: true, get: function () { return cardPaymentViewReducer_1.addCardPaymentSource; } });
|
|
1408
|
+
Object.defineProperty(exports, "fetchPaymentSources", { enumerable: true, get: function () { return cardPaymentViewReducer_1.fetchPaymentSources; } });
|
|
1409
|
+
Object.defineProperty(exports, "clearCardPaymentView", { enumerable: true, get: function () { return cardPaymentViewReducer_1.clearCardPaymentView; } });
|
|
1401
1410
|
const auditReportViewSelector_1 = require("./view/auditReportView/auditReportViewSelector");
|
|
1402
1411
|
Object.defineProperty(exports, "getAuditReportGroupViewSelectorView", { enumerable: true, get: function () { return auditReportViewSelector_1.getAuditReportGroupViewSelectorView; } });
|
|
1403
1412
|
Object.defineProperty(exports, "getAuditRuleGroupViewSelectorView", { enumerable: true, get: function () { return auditReportViewSelector_1.getAuditRuleGroupViewSelectorView; } });
|
package/lib/reducer.d.ts
CHANGED
|
@@ -164,6 +164,8 @@ import { ToastNotificationState } from './entity/toastNotification/toastNotifica
|
|
|
164
164
|
import { NotificationViewState } from './view/notificationView/notificationViewState';
|
|
165
165
|
import { VendorTabViewState } from './view/vendorTabView/vendorTabViewState';
|
|
166
166
|
import { CompanyTaskManagerViewState } from './view/companyTaskManagerView/companyTaskManagerViewState';
|
|
167
|
+
import { CardPaymentState } from './entity/cardPayment/cardPaymentState';
|
|
168
|
+
import { CardPaymentViewState } from './view/cardPayment/cardPaymentViewState';
|
|
167
169
|
declare type EntitiesState = {
|
|
168
170
|
accountGroupState: AccountGroupState;
|
|
169
171
|
accountingSummaryState: AccountingSummaryState;
|
|
@@ -172,6 +174,7 @@ declare type EntitiesState = {
|
|
|
172
174
|
approvalRuleState: ApprovalRuleState;
|
|
173
175
|
bankAccountState: BankAccountState;
|
|
174
176
|
billTransactionState: BillTransactionState;
|
|
177
|
+
cardPaymentState: CardPaymentState;
|
|
175
178
|
chargeCardState: ChargeCardState;
|
|
176
179
|
chargeCardTransactionState: ChargeCardTransactionState;
|
|
177
180
|
classState: ClassState;
|
|
@@ -240,6 +243,7 @@ declare type ViewsState = {
|
|
|
240
243
|
billPaySetupApproverViewState: BillPaySetupApproverViewState;
|
|
241
244
|
billPaySetupViewState: BillPaySetupViewState;
|
|
242
245
|
cardBalanceState: CardBalanceState;
|
|
246
|
+
cardPaymentViewState: CardPaymentViewState;
|
|
243
247
|
cashbackDetailState: CashbackDetailState;
|
|
244
248
|
cashBalanceState: CashBalanceState;
|
|
245
249
|
cashFlowState: CashFlowState;
|
|
@@ -358,6 +362,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
358
362
|
cardBalanceState: CardBalanceState;
|
|
359
363
|
cashbackDetailState: CashbackDetailState;
|
|
360
364
|
cashBalanceState: CashBalanceState;
|
|
365
|
+
cardPaymentViewState: CardPaymentViewState;
|
|
361
366
|
cashFlowState: CashFlowState;
|
|
362
367
|
cashInCashOutState: CashInCashOutState;
|
|
363
368
|
cashPositionState: CashPositionState;
|
|
@@ -459,6 +464,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
459
464
|
bankAccountState: BankAccountState;
|
|
460
465
|
billPayConfigState: BillPayConfigState;
|
|
461
466
|
billTransactionState: BillTransactionState;
|
|
467
|
+
cardPaymentState: CardPaymentState;
|
|
462
468
|
chargeCardState: ChargeCardState;
|
|
463
469
|
chargeCardTransactionState: ChargeCardTransactionState;
|
|
464
470
|
classState: ClassState;
|
package/lib/reducer.js
CHANGED
|
@@ -195,6 +195,8 @@ const toastNotificationReducer_1 = __importStar(require("./entity/toastNotificat
|
|
|
195
195
|
const notificationViewReducer_1 = __importStar(require("./view/notificationView/notificationViewReducer"));
|
|
196
196
|
const vendorTabViewReducer_1 = __importStar(require("./view/vendorTabView/vendorTabViewReducer"));
|
|
197
197
|
const companyTaskManagerViewReducer_1 = __importStar(require("./view/companyTaskManagerView/companyTaskManagerViewReducer"));
|
|
198
|
+
const cardPaymentViewReducer_1 = __importStar(require("./view/cardPayment/cardPaymentViewReducer"));
|
|
199
|
+
const cardPaymentReducer_1 = __importStar(require("./entity/cardPayment/cardPaymentReducer"));
|
|
198
200
|
// Note: Please maintain strict alphabetical order
|
|
199
201
|
const initialEntitiesState = {
|
|
200
202
|
accountGroupState: accountGroupReducer_1.initialState,
|
|
@@ -204,6 +206,7 @@ const initialEntitiesState = {
|
|
|
204
206
|
approvalRuleState: approvalRuleReducer_1.initialState,
|
|
205
207
|
bankAccountState: bankAccountReducer_1.initialState,
|
|
206
208
|
billTransactionState: billTransactionReducer_1.initialState,
|
|
209
|
+
cardPaymentState: cardPaymentReducer_1.initialState,
|
|
207
210
|
chargeCardState: chargeCardReducer_1.initialState,
|
|
208
211
|
chargeCardTransactionState: chargeCardTransactionReducer_1.initialState,
|
|
209
212
|
classState: classReducer_1.initialState,
|
|
@@ -273,6 +276,7 @@ const initialViewsState = {
|
|
|
273
276
|
billPaySetupApproverViewState: billPaySetupApproverViewReducer_1.initialState,
|
|
274
277
|
billPaySetupViewState: billPaySetupViewReducer_1.initialState,
|
|
275
278
|
cardBalanceState: cardBalanceReducer_1.initialState,
|
|
279
|
+
cardPaymentViewState: cardPaymentViewReducer_1.initialState,
|
|
276
280
|
cashbackDetailState: cashbackDetailReducer_1.initialState,
|
|
277
281
|
cashBalanceState: cashBalanceReducer_1.initialState,
|
|
278
282
|
cashFlowState: cashFlowReducer_1.initialState,
|
|
@@ -379,6 +383,7 @@ const entityReducers = {
|
|
|
379
383
|
bankAccountState: bankAccountReducer_1.default,
|
|
380
384
|
billPayConfigState: billPayConfigReducer_1.default,
|
|
381
385
|
billTransactionState: billTransactionReducer_1.default,
|
|
386
|
+
cardPaymentState: cardPaymentReducer_1.default,
|
|
382
387
|
chargeCardState: chargeCardReducer_1.default,
|
|
383
388
|
chargeCardTransactionState: chargeCardTransactionReducer_1.default,
|
|
384
389
|
classState: classReducer_1.default,
|
|
@@ -449,6 +454,7 @@ const viewReducers = {
|
|
|
449
454
|
cardBalanceState: cardBalanceReducer_1.default,
|
|
450
455
|
cashbackDetailState: cashbackDetailReducer_1.default,
|
|
451
456
|
cashBalanceState: cashBalanceReducer_1.default,
|
|
457
|
+
cardPaymentViewState: cardPaymentViewReducer_1.default,
|
|
452
458
|
cashFlowState: cashFlowReducer_1.default,
|
|
453
459
|
cashInCashOutState: cashInCashOutReducer_1.default,
|
|
454
460
|
cashPositionState: cashPositionReducer_1.default,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CardPaymentPayload, BankAccountPayload } from '../../entity/cardPayment/cardPaymentPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
import { SetupIntentData } from './cardPaymentViewState';
|
|
4
|
+
export declare type DeleteCardPaymentResponse = ZeniAPIResponse<FetchCardSetupIntentPayload>;
|
|
5
|
+
export interface FetchCardSetupIntentPayload {
|
|
6
|
+
client_secret: string;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FetchConfirmCardSetupError {
|
|
10
|
+
code: string;
|
|
11
|
+
message: string;
|
|
12
|
+
param: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface FetchConfirmCardSetupResponse {
|
|
16
|
+
setupIntent?: SetupIntentData;
|
|
17
|
+
error?: FetchConfirmCardSetupError;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfirmSetupIntentPayload {
|
|
21
|
+
payment_method_types: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare type FetchCardSetupIntentResponse = ZeniAPIResponse<FetchCardSetupIntentPayload>;
|
|
24
|
+
export interface AddCardPaymentSourcePayload {
|
|
25
|
+
type: string;
|
|
26
|
+
processor_token: string;
|
|
27
|
+
payment_source_type: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CardsOrBanksType {
|
|
30
|
+
cards?: CardPaymentPayload[];
|
|
31
|
+
bank_accounts?: BankAccountPayload[];
|
|
32
|
+
}
|
|
33
|
+
export interface AddCardPaymentSourceResponse {
|
|
34
|
+
companies: unknown[];
|
|
35
|
+
payment_sources: CardsOrBanksType;
|
|
36
|
+
}
|
|
37
|
+
export declare type FetchAddCardPaymentSourceResponse = ZeniAPIResponse<AddCardPaymentSourceResponse>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CardPaymentViewState, SetupIntentData } from './cardPaymentViewState';
|
|
2
|
+
import { FetchState } from '../../commonStateTypes/common';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { AddCardPaymentSourceResponse, CardsOrBanksType } from './cardPaymentViewPayload';
|
|
5
|
+
export declare const initialState: CardPaymentViewState;
|
|
6
|
+
export declare const createCardSetupIntent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentsMethod: string[]], {
|
|
7
|
+
paymentsMethod: string[];
|
|
8
|
+
}, string, never, never>, updateCardSetupIntentStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
fetchState: FetchState;
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
12
|
+
}, string>, confirmCardSetupIntent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupIntentData: any], {
|
|
13
|
+
setupIntentData: any;
|
|
14
|
+
}, string, never, never>, updateConfirmCardSetupIntentStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
fetchState: FetchState;
|
|
16
|
+
setupIntentData?: SetupIntentData | undefined;
|
|
17
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
18
|
+
}, string>, addCardPaymentSource: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[type: "card" | "direct_debit", paymentSourceType: string, setupIntentId: string], {
|
|
19
|
+
type: "card" | "direct_debit";
|
|
20
|
+
paymentSourceType: string;
|
|
21
|
+
setupIntentId: string;
|
|
22
|
+
}, string, never, never>, updateAddCardPaymentSourceStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
23
|
+
fetchState: FetchState;
|
|
24
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
25
|
+
payment_sources?: CardsOrBanksType | undefined;
|
|
26
|
+
}, string>, fetchPaymentSources: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updatePaymentSources: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
|
+
fetchState: FetchState;
|
|
28
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
29
|
+
response?: AddCardPaymentSourceResponse | undefined;
|
|
30
|
+
}, string>, clearCardPaymentView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
31
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<CardPaymentViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearCardPaymentView = exports.updatePaymentSources = exports.fetchPaymentSources = exports.updateAddCardPaymentSourceStatus = exports.addCardPaymentSource = exports.updateConfirmCardSetupIntentStatus = exports.confirmCardSetupIntent = exports.updateCardSetupIntentStatus = exports.createCardSetupIntent = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
cardPaymentsIDs: [],
|
|
8
|
+
bankAccountIDs: [],
|
|
9
|
+
clientSecret: '',
|
|
10
|
+
fetchState: 'Not-Started',
|
|
11
|
+
error: undefined,
|
|
12
|
+
cardDeleteStatusById: {},
|
|
13
|
+
cardSetupIntentStatus: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
},
|
|
17
|
+
cardSetupConfirmStatus: {
|
|
18
|
+
fetchState: 'Not-Started',
|
|
19
|
+
error: undefined,
|
|
20
|
+
},
|
|
21
|
+
addCardPaymentSourceStatus: {
|
|
22
|
+
fetchState: 'Not-Started',
|
|
23
|
+
error: undefined,
|
|
24
|
+
},
|
|
25
|
+
hasValidState() {
|
|
26
|
+
return this.fetchState == 'Completed';
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const cardPaymentView = (0, toolkit_1.createSlice)({
|
|
30
|
+
name: 'cardPaymentView',
|
|
31
|
+
initialState: exports.initialState,
|
|
32
|
+
reducers: {
|
|
33
|
+
createCardSetupIntent: {
|
|
34
|
+
reducer(draft) {
|
|
35
|
+
draft.cardSetupIntentStatus = {
|
|
36
|
+
fetchState: 'In-Progress',
|
|
37
|
+
error: undefined,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
prepare(paymentsMethod) {
|
|
41
|
+
return {
|
|
42
|
+
payload: { paymentsMethod }, // Add the payload property
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
updateCardSetupIntentStatus(draft, action) {
|
|
47
|
+
draft.clientSecret = action.payload.clientSecret;
|
|
48
|
+
draft.cardSetupIntentStatus = {
|
|
49
|
+
fetchState: action.payload.fetchState,
|
|
50
|
+
error: action.payload.error,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
confirmCardSetupIntent: {
|
|
54
|
+
reducer(draft) {
|
|
55
|
+
draft.cardSetupConfirmStatus = {
|
|
56
|
+
fetchState: 'In-Progress',
|
|
57
|
+
error: undefined,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
prepare(setupIntentData) {
|
|
61
|
+
return {
|
|
62
|
+
payload: { setupIntentData },
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
updateConfirmCardSetupIntentStatus(draft, action) {
|
|
67
|
+
if (action.payload.setupIntentData != null) {
|
|
68
|
+
draft.setupIntentData = action.payload.setupIntentData;
|
|
69
|
+
}
|
|
70
|
+
draft.cardSetupConfirmStatus = {
|
|
71
|
+
fetchState: action.payload.fetchState,
|
|
72
|
+
error: action.payload.error,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
addCardPaymentSource: {
|
|
76
|
+
reducer(draft) {
|
|
77
|
+
draft.addCardPaymentSourceStatus = {
|
|
78
|
+
fetchState: 'In-Progress',
|
|
79
|
+
error: undefined,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
prepare(type, paymentSourceType, setupIntentId) {
|
|
83
|
+
return {
|
|
84
|
+
payload: { type, paymentSourceType, setupIntentId },
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
updateAddCardPaymentSourceStatus(state, action) {
|
|
89
|
+
var _a;
|
|
90
|
+
state.addCardPaymentSourceStatus.fetchState = action.payload.fetchState;
|
|
91
|
+
state.addCardPaymentSourceStatus.error = action.payload.error;
|
|
92
|
+
const paymentMethods = action.payload.payment_sources;
|
|
93
|
+
if (paymentMethods != null) {
|
|
94
|
+
const cardIds = (_a = paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.cards) === null || _a === void 0 ? void 0 : _a.map((card) => card.id);
|
|
95
|
+
if (cardIds) {
|
|
96
|
+
state.cardPaymentsIDs = cardIds;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
fetchPaymentSources(state) {
|
|
101
|
+
state.fetchState = 'In-Progress';
|
|
102
|
+
},
|
|
103
|
+
updatePaymentSources(state, action) {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
state.addCardPaymentSourceStatus.fetchState = action.payload.fetchState;
|
|
106
|
+
state.addCardPaymentSourceStatus.error = action.payload.error;
|
|
107
|
+
const paymentMethods = (_a = action.payload.response) === null || _a === void 0 ? void 0 : _a.payment_sources;
|
|
108
|
+
if (paymentMethods) {
|
|
109
|
+
const cardIds = (_b = paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.cards) === null || _b === void 0 ? void 0 : _b.map((card) => card.id);
|
|
110
|
+
if (cardIds) {
|
|
111
|
+
state.cardPaymentsIDs = cardIds;
|
|
112
|
+
}
|
|
113
|
+
const bankAccountIds = (_c = paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.bank_accounts) === null || _c === void 0 ? void 0 : _c.map((bankAccount) => bankAccount.id);
|
|
114
|
+
if (bankAccountIds) {
|
|
115
|
+
state.bankAccountIDs = bankAccountIds;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
clearCardPaymentView(draft) {
|
|
120
|
+
Object.assign(draft, exports.initialState);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
_a = cardPaymentView.actions, exports.createCardSetupIntent = _a.createCardSetupIntent, exports.updateCardSetupIntentStatus = _a.updateCardSetupIntentStatus, exports.confirmCardSetupIntent = _a.confirmCardSetupIntent, exports.updateConfirmCardSetupIntentStatus = _a.updateConfirmCardSetupIntentStatus, exports.addCardPaymentSource = _a.addCardPaymentSource, exports.updateAddCardPaymentSourceStatus = _a.updateAddCardPaymentSourceStatus, exports.fetchPaymentSources = _a.fetchPaymentSources, exports.updatePaymentSources = _a.updatePaymentSources, exports.clearCardPaymentView = _a.clearCardPaymentView;
|
|
125
|
+
exports.default = cardPaymentView.reducer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { BankAccount, CardPayment } from '../../entity/cardPayment/cardPaymentState';
|
|
4
|
+
import { RootState } from '../../reducer';
|
|
5
|
+
import { SetupIntentData } from './cardPaymentViewState';
|
|
6
|
+
export interface CardPaymentSelectorView extends SelectorView {
|
|
7
|
+
cardsList: CardPayment[];
|
|
8
|
+
bankAccountsList: BankAccount[];
|
|
9
|
+
cardDeleteStatusById: Record<ID, FetchStateAndError>;
|
|
10
|
+
addCardPaymentSourceStatus: FetchStateAndError;
|
|
11
|
+
cardSetupConfirmStatus: FetchStateAndError;
|
|
12
|
+
cardSetupIntentStatus: FetchStateAndError;
|
|
13
|
+
clientSecret?: string;
|
|
14
|
+
setupIntentData?: SetupIntentData;
|
|
15
|
+
}
|
|
16
|
+
export declare const getAllCardsAndBankPaymentMethods: (state: RootState) => CardPaymentSelectorView;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllCardsAndBankPaymentMethods = void 0;
|
|
4
|
+
const cardPaymentSelector_1 = require("../../entity/cardPayment/cardPaymentSelector");
|
|
5
|
+
const getAllCardsAndBankPaymentMethods = (state) => {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const { cardPaymentState, cardPaymentViewState } = state;
|
|
8
|
+
const cardList = (0, cardPaymentSelector_1.getCardsByIds)(cardPaymentState, (_a = cardPaymentViewState.cardPaymentsIDs) !== null && _a !== void 0 ? _a : []);
|
|
9
|
+
const bankAccountList = (0, cardPaymentSelector_1.getBankAccountsByIds)(cardPaymentState, (_b = cardPaymentViewState.bankAccountIDs) !== null && _b !== void 0 ? _b : []);
|
|
10
|
+
return {
|
|
11
|
+
cardsList: cardList,
|
|
12
|
+
bankAccountsList: bankAccountList,
|
|
13
|
+
fetchState: cardPaymentViewState.fetchState,
|
|
14
|
+
clientSecret: (_c = cardPaymentViewState.clientSecret) !== null && _c !== void 0 ? _c : '',
|
|
15
|
+
setupIntentData: cardPaymentViewState.setupIntentData,
|
|
16
|
+
addCardPaymentSourceStatus: cardPaymentViewState.addCardPaymentSourceStatus,
|
|
17
|
+
cardDeleteStatusById: cardPaymentViewState.cardDeleteStatusById,
|
|
18
|
+
cardSetupConfirmStatus: cardPaymentViewState.cardSetupConfirmStatus,
|
|
19
|
+
cardSetupIntentStatus: cardPaymentViewState.cardSetupIntentStatus,
|
|
20
|
+
error: undefined,
|
|
21
|
+
version: 0,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.getAllCardsAndBankPaymentMethods = getAllCardsAndBankPaymentMethods;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PaymentMethod } from '@stripe/stripe-js';
|
|
2
|
+
import { FetchedState, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
3
|
+
export interface CardPaymentViewState extends FetchedState {
|
|
4
|
+
cardPaymentsIDs: ID[];
|
|
5
|
+
bankAccountIDs: ID[];
|
|
6
|
+
cardSetupConfirmStatus: FetchStateAndError;
|
|
7
|
+
cardSetupIntentStatus: FetchStateAndError;
|
|
8
|
+
addCardPaymentSourceStatus: FetchStateAndError;
|
|
9
|
+
cardDeleteStatusById: Record<ID, FetchStateAndError>;
|
|
10
|
+
setupIntentData?: SetupIntentData;
|
|
11
|
+
clientSecret?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SetupIntentData {
|
|
14
|
+
id: string;
|
|
15
|
+
status: string;
|
|
16
|
+
paymentMethod: string | null | PaymentMethod;
|
|
17
|
+
clientSecret?: string | null;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { addCardPaymentSource, fetchPaymentSources, updateAddCardPaymentSourceStatus } from '../cardPaymentViewReducer';
|
|
5
|
+
import { updateOnboardingCustomerViewUIState } from '../../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
6
|
+
import { updateZeniAccountSetupViewUIState } from '../../spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewReducer';
|
|
7
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof addCardPaymentSource> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAddCardPaymentSourceStatus> | ReturnType<typeof fetchPaymentSources> | ReturnType<typeof updateZeniAccountSetupViewUIState> | ReturnType<typeof updateOnboardingCustomerViewUIState>;
|
|
9
|
+
export declare const addCardPaymentSourceEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
10
|
+
payload: undefined;
|
|
11
|
+
type: string;
|
|
12
|
+
} | {
|
|
13
|
+
payload: Partial<import("../../spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewState").ZeniAccountSetupViewUIState>;
|
|
14
|
+
type: string;
|
|
15
|
+
} | {
|
|
16
|
+
payload: {
|
|
17
|
+
messageSection: "reimbursement_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated" | "create_setup_intent" | "confirm_card_setup_intent" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification";
|
|
18
|
+
messageText: "failed" | "success" | "notification";
|
|
19
|
+
type: import("../../..").SnackbarMessageType;
|
|
20
|
+
showStatusIcon?: boolean | undefined;
|
|
21
|
+
variables?: {
|
|
22
|
+
variableName: string;
|
|
23
|
+
variableValue: string;
|
|
24
|
+
}[] | undefined;
|
|
25
|
+
};
|
|
26
|
+
type: string;
|
|
27
|
+
} | {
|
|
28
|
+
payload: {
|
|
29
|
+
fetchState: import("../../..").FetchState;
|
|
30
|
+
error?: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
31
|
+
payment_sources?: import("../cardPaymentViewPayload").CardsOrBanksType | undefined;
|
|
32
|
+
};
|
|
33
|
+
type: string;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addCardPaymentSourceEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const cardPaymentViewReducer_1 = require("../cardPaymentViewReducer");
|
|
7
|
+
const onboardingCustomerViewReducer_1 = require("../../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
8
|
+
const zeniAccountSetupViewReducer_1 = require("../../spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewReducer");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
10
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
11
|
+
const addCardPaymentSourceEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cardPaymentViewReducer_1.addCardPaymentSource.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const { type, paymentSourceType, setupIntentId } = action.payload;
|
|
13
|
+
const payload = {
|
|
14
|
+
type: type,
|
|
15
|
+
processor_token: setupIntentId,
|
|
16
|
+
payment_source_type: paymentSourceType,
|
|
17
|
+
};
|
|
18
|
+
return handleAddCardPaymentSource(payload, zeniAPI);
|
|
19
|
+
}));
|
|
20
|
+
exports.addCardPaymentSourceEpic = addCardPaymentSourceEpic;
|
|
21
|
+
const handleAddCardPaymentSource = (payload, zeniAPI) => {
|
|
22
|
+
const cardPaymentSourcePayload = Object.assign({}, prepareCreateSetupIntentPayload(payload));
|
|
23
|
+
const addCardPaymentSourceApi$ = zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/subscriptions/payment-sources`, cardPaymentSourcePayload);
|
|
24
|
+
return addCardPaymentSourceApi$.pipe((0, operators_1.mergeMap)((response) => handleAddCardPaymentSourceResponse(response)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cardPaymentViewReducer_1.updateAddCardPaymentSourceStatus)({
|
|
25
|
+
fetchState: 'Error',
|
|
26
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Add Card Payment Source API call errored out ' +
|
|
27
|
+
JSON.stringify(error)),
|
|
28
|
+
}))));
|
|
29
|
+
};
|
|
30
|
+
const handleAddCardPaymentSourceResponse = (response) => {
|
|
31
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data) {
|
|
32
|
+
return (0, rxjs_1.from)([
|
|
33
|
+
(0, cardPaymentViewReducer_1.updateAddCardPaymentSourceStatus)({
|
|
34
|
+
fetchState: 'Completed',
|
|
35
|
+
payment_sources: response.data.payment_sources,
|
|
36
|
+
}),
|
|
37
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
38
|
+
messageSection: 'add_card_payment_source',
|
|
39
|
+
messageText: 'success',
|
|
40
|
+
type: 'success',
|
|
41
|
+
}),
|
|
42
|
+
(0, onboardingCustomerViewReducer_1.updateOnboardingCustomerViewUIState)({ isCardPaymentPopupOpen: false }),
|
|
43
|
+
(0, zeniAccountSetupViewReducer_1.updateZeniAccountSetupViewUIState)({ isCardPaymentPopupOpen: false }),
|
|
44
|
+
(0, cardPaymentViewReducer_1.fetchPaymentSources)(),
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return (0, rxjs_1.from)([
|
|
49
|
+
(0, cardPaymentViewReducer_1.updateAddCardPaymentSourceStatus)({
|
|
50
|
+
fetchState: 'Error',
|
|
51
|
+
error: response.status,
|
|
52
|
+
}),
|
|
53
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
54
|
+
messageSection: 'add_card_payment_source',
|
|
55
|
+
messageText: 'failed',
|
|
56
|
+
type: 'error',
|
|
57
|
+
variables: [
|
|
58
|
+
{
|
|
59
|
+
variableName: '_api-error_',
|
|
60
|
+
variableValue: response.status.message,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Helpers
|
|
69
|
+
*/
|
|
70
|
+
const prepareCreateSetupIntentPayload = (payload) => {
|
|
71
|
+
return {
|
|
72
|
+
type: payload.type,
|
|
73
|
+
processor_token: payload.processor_token,
|
|
74
|
+
payment_source_type: payload.payment_source_type,
|
|
75
|
+
};
|
|
76
|
+
};
|