@zeniai/client-epic-state 4.20.3-betaSS13 → 4.20.3-betaSS14
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/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +73 -37
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +1 -22
- package/lib/esm/view/creditAgentView/epics/downloadCreditReportEpic.js +20 -17
- package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +5 -5
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +8 -8
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +7 -7
- package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
- package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +5 -11
- package/lib/esm/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
- package/lib/index.d.ts +3 -3
- package/lib/index.js +12 -12
- package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +19 -8
- package/lib/view/creditAgentView/creditAgentViewReducer.js +76 -40
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +5 -15
- package/lib/view/creditAgentView/creditAgentViewState.js +0 -23
- package/lib/view/creditAgentView/epics/downloadCreditReportEpic.d.ts +20 -5
- package/lib/view/creditAgentView/epics/downloadCreditReportEpic.js +21 -16
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +4 -4
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +4 -4
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +6 -6
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +5 -5
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +5 -5
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +5 -5
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +5 -5
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +4 -10
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +9 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
- package/package.json +1 -1
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @see README.md in this directory for maintenance expectations.
|
|
18
18
|
*/
|
|
19
|
-
export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details' | 'dashboard' | 'cash_balance' | 'card_balance' | 'command_centre' | 'je_schedules' | 'reconciliation' | 'flux_analysis' | 'receipts' | 'mei' | 'task_checklist' | 'performance' | 'bills_list' | 'bills_details' | 'reimbursement_list' | 'reimbursement_details' | 'vendors_summary' | 'opex_by_vendor' | 'prepaid_expenses' | 'fixed_assets' | 'form_1099' | 'accrued_expenses' | 'forecast' | 'checking' | 'checking_details' | 'treasury' | 'cards' | 'cards_detail' | 'people' | 'rewards' | 'notifications';
|
|
19
|
+
export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details' | 'dashboard' | 'cash_balance' | 'card_balance' | 'cash_in_cash_out' | 'net_burn_or_income' | 'cash_position' | 'top_expenses' | 'revenue' | 'operating_expenses' | 'command_centre' | 'je_schedules' | 'reconciliation' | 'flux_analysis' | 'receipts' | 'mei' | 'task_checklist' | 'performance' | 'bills_list' | 'bills_details' | 'reimbursement_list' | 'reimbursement_details' | 'vendors_summary' | 'opex_by_vendor' | 'prepaid_expenses' | 'fixed_assets' | 'form_1099' | 'accrued_expenses' | 'forecast' | 'checking' | 'checking_details' | 'treasury' | 'cards' | 'cards_detail' | 'people' | 'rewards' | 'notifications';
|
|
@@ -78,6 +78,7 @@ import { clearScheduleAccruedDetailView } from '../../view/scheduleView/schedule
|
|
|
78
78
|
import { clearScheduleDetailView } from '../../view/scheduleView/scheduleDetailView/scheduleDetailReducer';
|
|
79
79
|
import { clearScheduleList } from '../../view/scheduleView/scheduleListView/scheduleListReducer';
|
|
80
80
|
import { clearSettingsView } from '../../view/settingsView/settingsViewReducer';
|
|
81
|
+
import { clearAutoTransferRules } from '../../view/spendManagement/autotransferRules/autoTransferRulesReducer';
|
|
81
82
|
import { clearBillDetailView } from '../../view/spendManagement/billPay/billDetailView/billDetailViewReducer';
|
|
82
83
|
import { clearBillList } from '../../view/spendManagement/billPay/billList/billListReducer';
|
|
83
84
|
import { clearBillPayConfig } from '../../view/spendManagement/billPay/billPayConfig/billPayConfigReducer';
|
|
@@ -202,7 +203,7 @@ import { clearAllUserRoles } from '../userRole/userRoleReducer';
|
|
|
202
203
|
import { clearAllVendors } from '../vendor/vendorReducer';
|
|
203
204
|
import { clearAllVendorExpenseTrends } from '../vendorExpense/vendorExpenseReducer';
|
|
204
205
|
import { clearAll } from './tenantReducer';
|
|
205
|
-
type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAllAiAccountantCustomers> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllProjects> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearProfitAndLossProjectView> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard>;
|
|
206
|
+
type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAllAiAccountantCustomers> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllProjects> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearAutoTransferRules> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearProfitAndLossProjectView> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard>;
|
|
206
207
|
type clearActionTypeForEntities = ReturnType<typeof clearAiCfo> | ReturnType<typeof clearAllAccountGroups> | ReturnType<typeof clearAllAccountRecon> | ReturnType<typeof clearAllAccountingSummary> | ReturnType<typeof clearAllAccounts> | ReturnType<typeof clearAllAddresses> | ReturnType<typeof clearAllApprovalRules> | ReturnType<typeof clearAllBankAccounts> | ReturnType<typeof clearAllBillTransactions> | ReturnType<typeof clearAllCardPayments> | ReturnType<typeof clearAllChargeCardRepayments> | ReturnType<typeof clearAllChargeCardTransactions> | ReturnType<typeof clearAllChargeCards> | ReturnType<typeof clearAllCompanies> | ReturnType<typeof clearAllConnectedAccounts> | ReturnType<typeof clearAllCurrencies> | ReturnType<typeof clearAllCustomerIncomeTrend> | ReturnType<typeof clearAllCustomers> | ReturnType<typeof clearAllDepositAccounts> | ReturnType<typeof clearAllEntities> | ReturnType<typeof clearAllEntityApprovalStatus> | ReturnType<typeof clearAllFiles> | ReturnType<typeof clearAllForecasts> | ReturnType<typeof clearAllGlobalMerchants> | ReturnType<typeof clearAllInsights> | ReturnType<typeof clearAllAccruedJESchedules> | ReturnType<typeof clearAllJEScheduleTransactions> | ReturnType<typeof clearAllMerchants> | ReturnType<typeof clearAllMonthEndCloseChecks> | ReturnType<typeof clearAllNotifications> | ReturnType<typeof clearAllOnboardingCustomersInfo> | ReturnType<typeof clearAllPaymentAccounts> | ReturnType<typeof clearAllPaymentInstruments> | ReturnType<typeof clearAllRecurringBills> | ReturnType<typeof clearAllReimbursements> | ReturnType<typeof clearAllSectionsAccountsView> | ReturnType<typeof clearAllSectionsClassesViewV2> | ReturnType<typeof clearAllSectionsProjectView> | ReturnType<typeof clearAllSubscriptionAddOns> | ReturnType<typeof clearAllSubscriptionCoupons> | ReturnType<typeof clearAllSubscriptionPlans> | ReturnType<typeof clearAllSubscriptionSummary> | ReturnType<typeof clearAllSubscriptions> | ReturnType<typeof clearAllTags> | ReturnType<typeof clearAllTaskGroups> | ReturnType<typeof clearAllTaskGroupTemplates> | ReturnType<typeof clearAllTaskSummary> | ReturnType<typeof clearAllTasks> | ReturnType<typeof clearAllToastNotifications> | ReturnType<typeof clearAllTransactions> | ReturnType<typeof clearAllUserRoles> | ReturnType<typeof clearAllUsers> | ReturnType<typeof clearAllVendorExpenseTrends> | ReturnType<typeof clearAllVendors> | ReturnType<typeof clearClassList> | ReturnType<typeof clearContacts> | ReturnType<typeof clearCountryList> | ReturnType<typeof clearDepositAccountTransaction> | ReturnType<typeof clearSnackbar>;
|
|
207
208
|
export type ActionType = clearActionTypeForViews | clearActionTypeForEntities | ReturnType<typeof clearAll>;
|
|
208
209
|
export declare const clearAllEpic: (actions$: ActionsObservable<ActionType>) => import("rxjs").Observable<ActionType>;
|
|
@@ -82,6 +82,7 @@ const scheduleAccruedDetailReducer_1 = require("../../view/scheduleView/schedule
|
|
|
82
82
|
const scheduleDetailReducer_1 = require("../../view/scheduleView/scheduleDetailView/scheduleDetailReducer");
|
|
83
83
|
const scheduleListReducer_1 = require("../../view/scheduleView/scheduleListView/scheduleListReducer");
|
|
84
84
|
const settingsViewReducer_1 = require("../../view/settingsView/settingsViewReducer");
|
|
85
|
+
const autoTransferRulesReducer_1 = require("../../view/spendManagement/autotransferRules/autoTransferRulesReducer");
|
|
85
86
|
const billDetailViewReducer_1 = require("../../view/spendManagement/billPay/billDetailView/billDetailViewReducer");
|
|
86
87
|
const billListReducer_1 = require("../../view/spendManagement/billPay/billList/billListReducer");
|
|
87
88
|
const billPayConfigReducer_1 = require("../../view/spendManagement/billPay/billPayConfig/billPayConfigReducer");
|
|
@@ -226,6 +227,7 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
|
|
|
226
227
|
(0, arAgingReducer_1.clearArAging)(),
|
|
227
228
|
(0, arAgingDetailReducer_1.clearArAgingDetail)(),
|
|
228
229
|
(0, authenticationViewReducer_1.clearAuthenticationView)(),
|
|
230
|
+
(0, autoTransferRulesReducer_1.clearAutoTransferRules)(),
|
|
229
231
|
(0, balanceSheetReducer_1.clearBalanceSheet)(),
|
|
230
232
|
(0, bankAccountViewReducer_1.clearBankAccountView)(),
|
|
231
233
|
(0, billDetailViewReducer_1.clearBillDetailView)(),
|
|
@@ -79,6 +79,7 @@ import { clearScheduleAccruedDetailView } from '../../view/scheduleView/schedule
|
|
|
79
79
|
import { clearScheduleDetailView } from '../../view/scheduleView/scheduleDetailView/scheduleDetailReducer';
|
|
80
80
|
import { clearScheduleList } from '../../view/scheduleView/scheduleListView/scheduleListReducer';
|
|
81
81
|
import { clearSettingsView } from '../../view/settingsView/settingsViewReducer';
|
|
82
|
+
import { clearAutoTransferRules } from '../../view/spendManagement/autotransferRules/autoTransferRulesReducer';
|
|
82
83
|
import { clearBillDetailView } from '../../view/spendManagement/billPay/billDetailView/billDetailViewReducer';
|
|
83
84
|
import { clearBillList } from '../../view/spendManagement/billPay/billList/billListReducer';
|
|
84
85
|
import { clearBillPayConfig } from '../../view/spendManagement/billPay/billPayConfig/billPayConfigReducer';
|
|
@@ -223,6 +224,7 @@ export const clearAllEpic = (actions$) => actions$.pipe(filter(clearAll.match),
|
|
|
223
224
|
clearArAging(),
|
|
224
225
|
clearArAgingDetail(),
|
|
225
226
|
clearAuthenticationView(),
|
|
227
|
+
clearAutoTransferRules(),
|
|
226
228
|
clearBalanceSheet(),
|
|
227
229
|
clearBankAccountView(),
|
|
228
230
|
clearBillDetailView(),
|
package/lib/esm/index.js
CHANGED
|
@@ -631,5 +631,5 @@ export { getAutoTransferRules, getAutoTransferRuleById, getAutoTransferRuleHisto
|
|
|
631
631
|
export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS, } from './view/expenseAutomationView/helpers/bulkUploadTiming';
|
|
632
632
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
633
633
|
export { getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
|
634
|
-
export { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro,
|
|
634
|
+
export { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, fetchCreditAgentMacroSuccess, fetchCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCreditAgentAccess, fetchCreditAgentAccessSuccess, fetchCreditAgentAccessFailure, fetchCardProfiles, fetchCardProfilesSuccess, fetchCardProfilesFailure, updateCardProfile, updateCardProfileSuccess, updateCardProfileFailure, downloadCreditReport, downloadCreditReportSuccess, downloadCreditReportFailure, } from './view/creditAgentView/creditAgentViewReducer';
|
|
635
635
|
export { getCreditAgentMacro, getScheduleCronState, getCardProfilesData, } from './view/creditAgentView/creditAgentViewSelector';
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
2
|
+
export const initialCreditAgentViewState = {
|
|
3
|
+
access: {
|
|
4
|
+
fetchState: 'Not-Started',
|
|
5
|
+
isAllowed: null,
|
|
6
|
+
},
|
|
7
|
+
cardProfiles: {
|
|
8
|
+
downloadState: 'Not-Started',
|
|
9
|
+
error: undefined,
|
|
10
|
+
fetchState: 'Not-Started',
|
|
11
|
+
rows: [],
|
|
12
|
+
},
|
|
13
|
+
macro: {
|
|
14
|
+
data: null,
|
|
15
|
+
error: undefined,
|
|
16
|
+
fetchState: 'Not-Started',
|
|
17
|
+
updateState: 'Not-Started',
|
|
18
|
+
},
|
|
19
|
+
scheduleCron: {
|
|
20
|
+
error: undefined,
|
|
21
|
+
fetchState: 'Not-Started',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
3
24
|
const creditAgentView = createSlice({
|
|
4
25
|
name: 'creditAgentView',
|
|
5
26
|
initialState: initialCreditAgentViewState,
|
|
@@ -8,19 +29,22 @@ const creditAgentView = createSlice({
|
|
|
8
29
|
draft.access.fetchState = 'In-Progress';
|
|
9
30
|
draft.access.isAllowed = null;
|
|
10
31
|
},
|
|
11
|
-
|
|
32
|
+
fetchCreditAgentAccessSuccess(draft, action) {
|
|
12
33
|
draft.access.fetchState = 'Completed';
|
|
13
34
|
draft.access.isAllowed = action.payload;
|
|
14
35
|
},
|
|
15
|
-
|
|
36
|
+
fetchCreditAgentAccessFailure(draft, action) {
|
|
16
37
|
draft.access.fetchState = 'Error';
|
|
17
|
-
draft.access.
|
|
38
|
+
draft.access.error = action.payload;
|
|
18
39
|
},
|
|
19
|
-
scheduleTenantCreditScoreCron
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
scheduleTenantCreditScoreCron: {
|
|
41
|
+
reducer(draft) {
|
|
42
|
+
draft.scheduleCron.fetchState = 'In-Progress';
|
|
43
|
+
draft.scheduleCron.error = undefined;
|
|
44
|
+
},
|
|
45
|
+
prepare(tenantId) {
|
|
46
|
+
return { payload: { tenantId } };
|
|
47
|
+
},
|
|
24
48
|
},
|
|
25
49
|
scheduleTenantCreditScoreCronSuccess(draft) {
|
|
26
50
|
draft.scheduleCron.fetchState = 'Completed';
|
|
@@ -38,20 +62,23 @@ const creditAgentView = createSlice({
|
|
|
38
62
|
draft.macro.fetchState = 'In-Progress';
|
|
39
63
|
draft.macro.error = undefined;
|
|
40
64
|
},
|
|
41
|
-
|
|
65
|
+
fetchCreditAgentMacroSuccess(draft, action) {
|
|
42
66
|
draft.macro.fetchState = 'Completed';
|
|
43
67
|
draft.macro.error = undefined;
|
|
44
68
|
draft.macro.data = mapMacroPayload(action.payload);
|
|
45
69
|
},
|
|
46
|
-
|
|
70
|
+
fetchCreditAgentMacroFailure(draft, action) {
|
|
47
71
|
draft.macro.fetchState = 'Error';
|
|
48
72
|
draft.macro.error = action.payload;
|
|
49
73
|
},
|
|
50
|
-
saveCreditAgentMacro
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
saveCreditAgentMacro: {
|
|
75
|
+
reducer(draft) {
|
|
76
|
+
draft.macro.updateState = 'In-Progress';
|
|
77
|
+
draft.macro.error = undefined;
|
|
78
|
+
},
|
|
79
|
+
prepare(instructions) {
|
|
80
|
+
return { payload: { instructions } };
|
|
81
|
+
},
|
|
55
82
|
},
|
|
56
83
|
saveCreditAgentMacroSuccess(draft, action) {
|
|
57
84
|
draft.macro.updateState = 'Completed';
|
|
@@ -70,40 +97,49 @@ const creditAgentView = createSlice({
|
|
|
70
97
|
draft.cardProfiles.fetchState = 'In-Progress';
|
|
71
98
|
draft.cardProfiles.error = undefined;
|
|
72
99
|
},
|
|
73
|
-
|
|
100
|
+
fetchCardProfilesSuccess(draft, action) {
|
|
74
101
|
draft.cardProfiles.fetchState = 'Completed';
|
|
75
102
|
draft.cardProfiles.error = undefined;
|
|
76
103
|
draft.cardProfiles.rows = action.payload;
|
|
77
104
|
},
|
|
78
|
-
|
|
105
|
+
fetchCardProfilesFailure(draft, action) {
|
|
79
106
|
draft.cardProfiles.fetchState = 'Error';
|
|
80
107
|
draft.cardProfiles.error = action.payload;
|
|
81
108
|
},
|
|
82
|
-
updateCardProfile
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
updateCardProfile: {
|
|
110
|
+
reducer() {
|
|
111
|
+
// action dispatched to trigger the epic; no optimistic state update needed
|
|
112
|
+
},
|
|
113
|
+
prepare(payload) {
|
|
114
|
+
return { payload };
|
|
115
|
+
},
|
|
88
116
|
},
|
|
89
|
-
|
|
117
|
+
updateCardProfileSuccess(draft, action) {
|
|
90
118
|
const { tenantNamespace, profile } = action.payload;
|
|
91
119
|
draft.cardProfiles.rows = draft.cardProfiles.rows.map((row) => row.tenantNamespace === tenantNamespace ? { ...row, ...profile } : row);
|
|
92
120
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
121
|
+
updateCardProfileFailure: {
|
|
122
|
+
reducer() {
|
|
123
|
+
// noop — the epic will surface the error via alert
|
|
124
|
+
},
|
|
125
|
+
prepare(payload) {
|
|
126
|
+
return { payload };
|
|
127
|
+
},
|
|
99
128
|
},
|
|
100
129
|
downloadCreditReport(draft) {
|
|
101
130
|
draft.cardProfiles.downloadState = 'In-Progress';
|
|
102
131
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
// Payload carries the CSV string so the consuming app can trigger the actual
|
|
133
|
+
// file download using its platform-appropriate mechanism (browser Blob / RN file API).
|
|
134
|
+
downloadCreditReportSuccess: {
|
|
135
|
+
reducer(draft) {
|
|
136
|
+
draft.cardProfiles.downloadState = 'Completed';
|
|
137
|
+
},
|
|
138
|
+
prepare(csv) {
|
|
139
|
+
return { payload: { csv } };
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
downloadCreditReportFailure(draft) {
|
|
107
143
|
draft.cardProfiles.downloadState = 'Error';
|
|
108
144
|
},
|
|
109
145
|
},
|
|
@@ -120,7 +156,7 @@ export function mapCardTenantProfileRowPayload(row) {
|
|
|
120
156
|
recommendedAmount: row.recommended_amount ?? null,
|
|
121
157
|
reportDate: row.report_date ?? null,
|
|
122
158
|
tenantId: row.tenant_id ?? null,
|
|
123
|
-
tenantNamespace:
|
|
159
|
+
tenantNamespace: row.tenant_namespace,
|
|
124
160
|
updatedByName: row.updated_by_name ?? null,
|
|
125
161
|
updatedByUserId: row.updated_by_user_id ?? null,
|
|
126
162
|
updatedOn: row.updated_on ?? null,
|
|
@@ -140,6 +176,6 @@ function mapMacroPayload(payload) {
|
|
|
140
176
|
updatedAt: payload.updated_at,
|
|
141
177
|
};
|
|
142
178
|
}
|
|
143
|
-
export const { fetchCreditAgentAccess,
|
|
179
|
+
export const { fetchCreditAgentAccess, fetchCreditAgentAccessSuccess, fetchCreditAgentAccessFailure, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, fetchCreditAgentMacroSuccess, fetchCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCardProfiles, fetchCardProfilesSuccess, fetchCardProfilesFailure, updateCardProfile, updateCardProfileSuccess, updateCardProfileFailure, downloadCreditReport, downloadCreditReportSuccess, downloadCreditReportFailure, } = creditAgentView.actions;
|
|
144
180
|
export { initialCreditAgentViewState as initialState };
|
|
145
181
|
export default creditAgentView.reducer;
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
access: {
|
|
3
|
-
fetchState: 'Not-Started',
|
|
4
|
-
isAllowed: null,
|
|
5
|
-
},
|
|
6
|
-
cardProfiles: {
|
|
7
|
-
downloadState: 'Not-Started',
|
|
8
|
-
error: undefined,
|
|
9
|
-
fetchState: 'Not-Started',
|
|
10
|
-
rows: [],
|
|
11
|
-
},
|
|
12
|
-
macro: {
|
|
13
|
-
data: null,
|
|
14
|
-
error: undefined,
|
|
15
|
-
fetchState: 'Not-Started',
|
|
16
|
-
updateState: 'Not-Started',
|
|
17
|
-
},
|
|
18
|
-
scheduleCron: {
|
|
19
|
-
error: undefined,
|
|
20
|
-
fetchState: 'Not-Started',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { downloadCreditReport,
|
|
4
|
-
const CSV_HEADERS = [
|
|
3
|
+
import { downloadCreditReport, downloadCreditReportFailure, downloadCreditReportSuccess, } from '../creditAgentViewReducer';
|
|
4
|
+
export const CSV_HEADERS = [
|
|
5
5
|
'Customer Name',
|
|
6
6
|
'Card Status',
|
|
7
7
|
'Credit Limit ($)',
|
|
@@ -15,7 +15,7 @@ const CSV_HEADERS = [
|
|
|
15
15
|
'Updated By',
|
|
16
16
|
'Updated On',
|
|
17
17
|
];
|
|
18
|
-
function rowToCsvLine(row) {
|
|
18
|
+
export function rowToCsvLine(row) {
|
|
19
19
|
const fields = [
|
|
20
20
|
row.customerName,
|
|
21
21
|
row.cardStatus,
|
|
@@ -37,23 +37,26 @@ function rowToCsvLine(row) {
|
|
|
37
37
|
})
|
|
38
38
|
.join(',');
|
|
39
39
|
}
|
|
40
|
+
export function buildCsvString(rows) {
|
|
41
|
+
const csvLines = [CSV_HEADERS.join(','), ...rows.map(rowToCsvLine)];
|
|
42
|
+
return csvLines.join('\n');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Epic: gather rows from state and emit downloadCreditReportSuccess with CSV data.
|
|
46
|
+
*
|
|
47
|
+
* This epic intentionally does NOT touch the DOM (no Blob, no document, no
|
|
48
|
+
* URL.createObjectURL). Those browser-only APIs would break SSR and React Native
|
|
49
|
+
* consumers of this shared package. The consuming web app should listen for
|
|
50
|
+
* downloadCreditReportSuccess and perform the actual file-save using its own
|
|
51
|
+
* platform-appropriate mechanism.
|
|
52
|
+
*/
|
|
40
53
|
export const downloadCreditReportEpic = (actions$, state$, _zeniAPI) => actions$.pipe(filter(downloadCreditReport.match), switchMap(() => {
|
|
41
54
|
try {
|
|
42
55
|
const rows = state$.value.creditAgentViewState.cardProfiles.rows;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
|
46
|
-
const objectUrl = URL.createObjectURL(blob);
|
|
47
|
-
const link = document.createElement('a');
|
|
48
|
-
link.href = objectUrl;
|
|
49
|
-
link.setAttribute('download', 'card-tenant-profiles.csv');
|
|
50
|
-
document.body.appendChild(link);
|
|
51
|
-
link.click();
|
|
52
|
-
document.body.removeChild(link);
|
|
53
|
-
URL.revokeObjectURL(objectUrl);
|
|
54
|
-
return of(downloadCreditReportCompleted());
|
|
56
|
+
const csv = buildCsvString(rows);
|
|
57
|
+
return of(downloadCreditReportSuccess(csv));
|
|
55
58
|
}
|
|
56
59
|
catch {
|
|
57
|
-
return of(
|
|
60
|
+
return of(downloadCreditReportFailure());
|
|
58
61
|
}
|
|
59
|
-
}), catchError(() => of(
|
|
62
|
+
}), catchError(() => of(downloadCreditReportFailure())));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCardProfiles,
|
|
4
|
+
import { fetchCardProfiles, fetchCardProfilesFailure, fetchCardProfilesSuccess, mapCardTenantProfileRowPayload, } from '../creditAgentViewReducer';
|
|
5
5
|
export const fetchCardProfilesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCardProfiles.match), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
9
|
const rows = (response.data.rows ?? []).map(mapCardTenantProfileRowPayload);
|
|
10
|
-
return of(
|
|
10
|
+
return of(fetchCardProfilesSuccess(rows));
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
return of(
|
|
13
|
+
return of(fetchCardProfilesFailure(response.status));
|
|
14
14
|
}
|
|
15
|
-
}), catchError((error) => of(
|
|
15
|
+
}), catchError((error) => of(fetchCardProfilesFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
16
16
|
}));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCreditAgentAccess,
|
|
5
|
-
export const fetchCreditAgentAccessEpic = (actions$,
|
|
2
|
+
import { catchError, filter, switchMap, withLatestFrom } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { fetchCreditAgentAccess, fetchCreditAgentAccessFailure, fetchCreditAgentAccessSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchCreditAgentAccessEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCreditAgentAccess.match), withLatestFrom(state$), filter(([, state]) => state.creditAgentViewState.access.fetchState !== 'In-Progress'), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/cards-cockpit-access`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(switchMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
9
|
-
return of(
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(fetchCreditAgentAccessSuccess(response.data.is_allowed === true));
|
|
10
10
|
}
|
|
11
|
-
return of(
|
|
12
|
-
}), catchError(() => of(
|
|
11
|
+
return of(fetchCreditAgentAccessFailure(response.status));
|
|
12
|
+
}), catchError((error) => of(fetchCreditAgentAccessFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
13
13
|
}));
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap, withLatestFrom } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchCreditAgentMacro,
|
|
5
|
-
export const fetchCreditAgentMacroEpic = (actions$,
|
|
4
|
+
import { fetchCreditAgentMacro, fetchCreditAgentMacroFailure, fetchCreditAgentMacroSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCreditAgentMacro.match), withLatestFrom(state$), filter(([, state]) => state.creditAgentViewState.macro.fetchState !== 'In-Progress'), switchMap(() => {
|
|
6
6
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
7
7
|
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
-
if (isSuccessResponse(response)
|
|
9
|
-
return of(
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(fetchCreditAgentMacroSuccess(response.data));
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return of(
|
|
12
|
+
return of(fetchCreditAgentMacroFailure(response.status));
|
|
13
13
|
}
|
|
14
|
-
}), catchError((error) => of(
|
|
14
|
+
}), catchError((error) => of(fetchCreditAgentMacroFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
15
15
|
}));
|
|
@@ -5,14 +5,19 @@ import { saveCreditAgentMacro, saveCreditAgentMacroFailure, saveCreditAgentMacro
|
|
|
5
5
|
export const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveCreditAgentMacro.match), switchMap((action) => {
|
|
6
6
|
const { instructions } = action.payload;
|
|
7
7
|
const existingMacro = state$.value.creditAgentViewState.macro.data;
|
|
8
|
+
// Fail fast if macro has not been loaded yet — avoids overwriting server-side
|
|
9
|
+
// name/description fields with empty defaults.
|
|
10
|
+
if (existingMacro == null) {
|
|
11
|
+
return of(saveCreditAgentMacroFailure(createZeniAPIStatus('Save failed', 'Cannot save macro: macro data has not been loaded yet.')));
|
|
12
|
+
}
|
|
8
13
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
9
14
|
const body = {
|
|
10
15
|
instructions,
|
|
11
|
-
name: existingMacro
|
|
12
|
-
description: existingMacro
|
|
16
|
+
name: existingMacro.name,
|
|
17
|
+
description: existingMacro.description,
|
|
13
18
|
};
|
|
14
19
|
return zeniAPI.putAndGetJSON(url, body).pipe(mergeMap((response) => {
|
|
15
|
-
if (isSuccessResponse(response)
|
|
20
|
+
if (isSuccessResponse(response)) {
|
|
16
21
|
return of(saveCreditAgentMacroSuccess(response.data));
|
|
17
22
|
}
|
|
18
23
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { updateCardProfile,
|
|
4
|
+
import { updateCardProfile, updateCardProfileFailure, updateCardProfileSuccess, mapCardTenantProfileRowPayload, } from '../creditAgentViewReducer';
|
|
5
5
|
export const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(updateCardProfile.match), switchMap((action) => {
|
|
6
6
|
const { tenantNamespace, update } = action.payload;
|
|
7
7
|
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
|
|
@@ -23,19 +23,13 @@ export const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pi
|
|
|
23
23
|
return zeniAPI.putAndGetJSON(url, body).pipe(mergeMap((response) => {
|
|
24
24
|
if (isSuccessResponse(response) && response.data?.profile != null) {
|
|
25
25
|
const mapped = mapCardTenantProfileRowPayload(response.data.profile);
|
|
26
|
-
return of(
|
|
27
|
-
profile:
|
|
28
|
-
cardStatus: mapped.cardStatus,
|
|
29
|
-
creditLimit: mapped.creditLimit,
|
|
30
|
-
updatedByName: mapped.updatedByName,
|
|
31
|
-
updatedByUserId: mapped.updatedByUserId,
|
|
32
|
-
updatedOn: mapped.updatedOn,
|
|
33
|
-
},
|
|
26
|
+
return of(updateCardProfileSuccess({
|
|
27
|
+
profile: mapped,
|
|
34
28
|
tenantNamespace,
|
|
35
29
|
}));
|
|
36
30
|
}
|
|
37
31
|
else {
|
|
38
|
-
return of(
|
|
32
|
+
return of(updateCardProfileFailure(response.status));
|
|
39
33
|
}
|
|
40
|
-
}), catchError((error) => of(
|
|
34
|
+
}), catchError((error) => of(updateCardProfileFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
41
35
|
}));
|
package/lib/esm/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js
CHANGED
|
@@ -4,9 +4,16 @@ import { getAllDepositAccounts, } from '../depositAccountList/depositAccountList
|
|
|
4
4
|
import { getAllPaymentAccounts, } from '../paymentAccountList/paymentAccountListSelector';
|
|
5
5
|
import { getZeniAccountsConfigDetail, } from '../zeniAccountsConfig/zeniAccountsConfigSelector';
|
|
6
6
|
export const getZeniAccountList = (state) => {
|
|
7
|
-
const { zeniAccountListState, depositAccountState, paymentAccountState, plaidAccountViewState, depositAccountListState, paymentAccountListState, } = state;
|
|
7
|
+
const { zeniAccountListState, depositAccountState, paymentAccountState, plaidAccountViewState, depositAccountListState, paymentAccountListState, autotransferRulesState, } = state;
|
|
8
8
|
const { plaidConnectionDetails } = plaidAccountViewState['external_account'];
|
|
9
|
-
const
|
|
9
|
+
const baseDepositAccountsSelectorView = getAllDepositAccounts(depositAccountState, depositAccountListState);
|
|
10
|
+
const depositAccountsSelectorView = {
|
|
11
|
+
...baseDepositAccountsSelectorView,
|
|
12
|
+
depositAccounts: baseDepositAccountsSelectorView.depositAccounts.map((depositAccount) => ({
|
|
13
|
+
...depositAccount,
|
|
14
|
+
autoTransferRules: autotransferRulesState.rules.filter((rule) => !rule.isDeleted && rule.sourceBankAccountId === depositAccount.id),
|
|
15
|
+
})),
|
|
16
|
+
};
|
|
10
17
|
const zeniAccountsConfig = getZeniAccountsConfigDetail(state);
|
|
11
18
|
const { paymentAccountIds } = paymentAccountListState;
|
|
12
19
|
const externalAccountsSelectorView = getAllPaymentAccounts(paymentAccountState, paymentAccountListState);
|
|
@@ -42,6 +49,6 @@ export const getZeniAccountList = (state) => {
|
|
|
42
49
|
plaidConnectionDetails,
|
|
43
50
|
externalAccountsSelectorView,
|
|
44
51
|
newCheckingAccount: zeniAccountListState.newCheckingAccount,
|
|
45
|
-
fetchState:
|
|
52
|
+
fetchState: baseDepositAccountsSelectorView.fetchState,
|
|
46
53
|
};
|
|
47
54
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -518,7 +518,7 @@ import { clearReviewTransferDetail, clearTransferDetail, fetchReviewTransferDeta
|
|
|
518
518
|
import { TransferDetailSelectorView, getTransferDetail } from './view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector';
|
|
519
519
|
import { ReviewTransferDetail, TransferDetailLocalData } from './view/spendManagement/zeniAccounts/transferDetail/transferDetailState';
|
|
520
520
|
import { createCheckingAccount, fetchZeniAccountList } from './view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListReducer';
|
|
521
|
-
import { ZeniAccountListSelectorView, getZeniAccountList } from './view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector';
|
|
521
|
+
import { DepositAccountWithAutoTransferRules, ZeniAccountListSelectorView, getZeniAccountList } from './view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector';
|
|
522
522
|
import { ZeniAccountSummaryWithBalance } from './view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListState';
|
|
523
523
|
import { acceptZeniAccountTerms, clearZeniAccountSetupView, fetchZeniAccountSetupView } from './view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewReducer';
|
|
524
524
|
import { ZeniAccountBusinessVerificationDetails, ZeniAccountSetupView, getZeniAccountBusinessVerificationDetails, getZeniAccountSetupViewDetails } from './view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector';
|
|
@@ -811,7 +811,7 @@ export { ReimbursementCardReport };
|
|
|
811
811
|
export { VendorListViewSortKey, VendorViewUIState, VendorListSelectorView, VendorListQuery, getVendorList, VendorListView, updateSortUiState, updatePageToken, updateYTDSelectionUIState, VendorListViewYTDSpendSortKey, isColumnYTDSpend, isVendorsTabVisible, VendorViewType, VendorReportIDType, toVendorReportIDType, VendorFiling1099ListSelectorView, getVendorFiling1099List, VendorFiling1099ListViewSortKey, VendorFiling1099ViewUIState, VendorFiling1099DownloadData, fetchVendorsFiling1099Download, Type1099Download, VendorFiling1099DownloadDataForType, };
|
|
812
812
|
export { fetchEntityRecommendationsByTransactionId, fetchRecommendationByEntityId, fetchRecommendationByEntityName, };
|
|
813
813
|
export { fetchOwnerList };
|
|
814
|
-
export { ZeniAccountsConfigSelectorView, getZeniAccountsConfigDetail, ZeniAccountListSelectorView, getZeniAccountList, fetchZeniAccountList, fetchAccountList, DepositAccount, createCheckingAccount, fetchPaymentAccountList, unlinkPaymentAccount, getDepositAccountDetail, DepositAccountDetailSelectorView, DepositAccountListSelectorView, getAllDepositAccounts, getDepositAccountDetailForPDF, DepositAccountDetailForPDF, fetchDepositAccount, fetchZeniAccountsConfig, AccountHistoryWithBalances, TransferDetailLocalData, ReviewTransferDetail, updateTransferMoneyLocalData, updateTransferToLocalData, updateDepositToLocalData, transferMoney, getTransferDetail, TransferDetailSelectorView, clearTransferDetail, clearReviewTransferDetail, fetchReviewTransferDetail, fetchDepositAccountDetail, DepositAccountTransaction, DepositTransactionStatusCode, DepositTransactionStatus, CheckDepositLocalData, depositCheck, updateCheckDepositLocalData, clearCheckDeposit, CheckDepositSelectorView, getCheckDepositDetail, updateDepositAccount, fetchDepositAccountHistorySuccess, fetchDepositAccountHistoryFailure, DepositAccountUpdateType, ZeniAccountSummaryWithBalance, fetchZeniAccStatementPage, getZeniAccStatements, ZeniAccStatementsSelectorView, ZeniAccountPaymentMethod, };
|
|
814
|
+
export { ZeniAccountsConfigSelectorView, getZeniAccountsConfigDetail, ZeniAccountListSelectorView, getZeniAccountList, fetchZeniAccountList, fetchAccountList, DepositAccount, createCheckingAccount, fetchPaymentAccountList, unlinkPaymentAccount, getDepositAccountDetail, DepositAccountDetailSelectorView, DepositAccountListSelectorView, getAllDepositAccounts, getDepositAccountDetailForPDF, DepositAccountDetailForPDF, fetchDepositAccount, fetchZeniAccountsConfig, AccountHistoryWithBalances, TransferDetailLocalData, ReviewTransferDetail, updateTransferMoneyLocalData, updateTransferToLocalData, updateDepositToLocalData, transferMoney, getTransferDetail, TransferDetailSelectorView, clearTransferDetail, clearReviewTransferDetail, fetchReviewTransferDetail, fetchDepositAccountDetail, DepositAccountTransaction, DepositAccountWithAutoTransferRules, DepositTransactionStatusCode, DepositTransactionStatus, CheckDepositLocalData, depositCheck, updateCheckDepositLocalData, clearCheckDeposit, CheckDepositSelectorView, getCheckDepositDetail, updateDepositAccount, fetchDepositAccountHistorySuccess, fetchDepositAccountHistoryFailure, DepositAccountUpdateType, ZeniAccountSummaryWithBalance, fetchZeniAccStatementPage, getZeniAccStatements, ZeniAccStatementsSelectorView, ZeniAccountPaymentMethod, };
|
|
815
815
|
export { CommonHistoryView, HistoricEvent, HistoricEventUpdate, ActivityHistorySelectorView, };
|
|
816
816
|
export { ActivityRealTimeApprovalSelectorView, Statement, fetchDepositAccountTransactionList, DepositAccountTransactionListSelectorView, getDepositAccountTransactionList, };
|
|
817
817
|
export { TransactionVendorLocalData, TransactionVendorState, TransactionVendorViewState, };
|
|
@@ -901,6 +901,6 @@ export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS,
|
|
|
901
901
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
902
902
|
export { TransactionActivityLogViewSelectorView, getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
|
903
903
|
export { UserGroup } from './entity/userGroups/userGroupsState';
|
|
904
|
-
export { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro,
|
|
904
|
+
export { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, fetchCreditAgentMacroSuccess, fetchCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, fetchCreditAgentAccess, fetchCreditAgentAccessSuccess, fetchCreditAgentAccessFailure, fetchCardProfiles, fetchCardProfilesSuccess, fetchCardProfilesFailure, updateCardProfile, updateCardProfileSuccess, updateCardProfileFailure, downloadCreditReport, downloadCreditReportSuccess, downloadCreditReportFailure, } from './view/creditAgentView/creditAgentViewReducer';
|
|
905
905
|
export { getCreditAgentMacro, getScheduleCronState, getCardProfilesData, } from './view/creditAgentView/creditAgentViewSelector';
|
|
906
906
|
export type { CreditAgentMacro, CreditAgentViewState, CardTenantProfileRow, CardStatus, } from './view/creditAgentView/creditAgentViewState';
|