@zeniai/client-epic-state 4.17.52 → 4.17.54
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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/epic/sendEmailMagicLinkToUserEpic.d.ts +3 -10
- package/lib/entity/tenant/epic/sendEmailMagicLinkToUserEpic.js +16 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +4 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.d.ts +2 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.js +10 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewPayload.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +18 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +1 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.js +7 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "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_setup" | "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" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "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" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "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" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "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" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "transactions_reviewed" | "transaction_reviewed" | "transaction_reviewed_failed" | "transactions_reviewed_failed" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "notify_admin_for_low_balance" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "send_email_magic_link_to_user" | "complete_profile_done";
|
|
1
|
+
export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "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_setup" | "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" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "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" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "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" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "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" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "transactions_reviewed" | "transaction_reviewed" | "transaction_reviewed_failed" | "transactions_reviewed_failed" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "notify_admin_for_low_balance" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done";
|
|
2
2
|
export type SnackbarMessageSections = ReturnType<typeof toSnackbarMessageSection>;
|
|
3
3
|
export declare const toSnackbarMessageSectionTexts: (v: string) => "notification" | "failed" | "success";
|
|
4
4
|
export type SnackbarMessageSectionTexts = ReturnType<typeof toSnackbarMessageSectionTexts>;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
2
3
|
import { RootState } from '../../../reducer';
|
|
3
4
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
5
|
import { sendEmailMagicLinkToUser, sendEmailMagicLinkToUserFailure, sendEmailMagicLinkToUserSuccess } from '../tenantReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof sendEmailMagicLinkToUser> | ReturnType<typeof sendEmailMagicLinkToUserSuccess> | ReturnType<typeof sendEmailMagicLinkToUserFailure>;
|
|
6
|
-
export declare const sendEmailMagicLinkToUserEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<
|
|
7
|
-
payload: {
|
|
8
|
-
codeVerifier: string;
|
|
9
|
-
};
|
|
10
|
-
type: "tenant/sendEmailMagicLinkToUserSuccess";
|
|
11
|
-
} | {
|
|
12
|
-
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
13
|
-
type: "tenant/sendEmailMagicLinkToUserFailure";
|
|
14
|
-
}>;
|
|
6
|
+
export type ActionType = ReturnType<typeof sendEmailMagicLinkToUser> | ReturnType<typeof sendEmailMagicLinkToUserSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof sendEmailMagicLinkToUserFailure>;
|
|
7
|
+
export declare const sendEmailMagicLinkToUserEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sendEmailMagicLinkToUserEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
6
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
7
8
|
const tenantReducer_1 = require("../tenantReducer");
|
|
8
9
|
const toRequestPayload = (email) => ({
|
|
@@ -17,9 +18,22 @@ const sendEmailMagicLinkToUserEpic = (actions$, _, zeniAPI) => actions$.pipe((0,
|
|
|
17
18
|
return (0, rxjs_1.of)((0, tenantReducer_1.sendEmailMagicLinkToUserSuccess)(response.data.code_verifier));
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
|
-
|
|
21
|
+
const actions = [];
|
|
22
|
+
actions.push((0, tenantReducer_1.sendEmailMagicLinkToUserFailure)(response.status));
|
|
23
|
+
if (response.status.code === 500) {
|
|
24
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
25
|
+
messageSection: 'send_email_magic_link_to_user',
|
|
26
|
+
messageText: 'failed',
|
|
27
|
+
type: 'error',
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
return (0, rxjs_1.from)(actions);
|
|
21
31
|
}
|
|
22
32
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tenantReducer_1.sendEmailMagicLinkToUserFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Send magic link to user API call errored out: ' +
|
|
23
|
-
JSON.stringify(error))))
|
|
33
|
+
JSON.stringify(error))), (0, snackbarReducer_1.openSnackbar)({
|
|
34
|
+
messageSection: 'send_email_magic_link_to_user',
|
|
35
|
+
messageText: 'failed',
|
|
36
|
+
type: 'error',
|
|
37
|
+
}))));
|
|
24
38
|
}));
|
|
25
39
|
exports.sendEmailMagicLinkToUserEpic = sendEmailMagicLinkToUserEpic;
|
package/lib/index.d.ts
CHANGED
|
@@ -474,7 +474,7 @@ import { RemisBulkReviewView, getRemisBulkOperationProgress, getRemisBulkReviewV
|
|
|
474
474
|
import { BillPayFilterCategoryDropdownOption, CategoryCombinationOperator, FilterCategoryType, MatchingOperatorDropdownOption, ReimbursementFilterCategoryDropdownOption, SpendManagementFilterCategoryDropdownOption, SpendManagementFilterEntityType, SpendManagementFiltersType, TaskFilterCategoryDropdownOption, hideCreatedByFilter } from './view/spendManagement/spendManagementFilterHelpers';
|
|
475
475
|
import { acceptTreasuryTerms, clearTreasurySetupView, fetchPortfolioAllocation, fetchTreasuryFunds, fetchTreasurySetupView, updateFundAllocationLocalData, updatePortfolioAllocation } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer';
|
|
476
476
|
import { TreasuryBusinessVerificationDetails, TreasurySetupView, getTreasuryBusinessVerificationDetails, getTreasurySetupViewDetails } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector';
|
|
477
|
-
import { FundAllocationOption, FundComposition, FundData } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewState';
|
|
477
|
+
import { FundAllocationOption, FundComposition, FundData, getTreasuryFundsMaximumYield } from './view/spendManagement/treasury/treasurySetUp/treasurySetupViewState';
|
|
478
478
|
import { clearCheckDeposit, depositCheck, updateLocalStore as updateCheckDepositLocalData, updateDepositToLocalData } from './view/spendManagement/zeniAccounts/checkDeposit/checkDepositReducer';
|
|
479
479
|
import { CheckDepositSelectorView, getCheckDepositDetail } from './view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector';
|
|
480
480
|
import { CheckDepositLocalData } from './view/spendManagement/zeniAccounts/checkDeposit/checkDepositState';
|
|
@@ -832,7 +832,7 @@ export { fetchCompanyTaskManagerView, CompanyTaskManagerSelectorView, CompanyTas
|
|
|
832
832
|
export { Country };
|
|
833
833
|
export { InternationalWireVerificationState, VerificationFormField, VerificationFormLocalData, FieldValueType, fetchInternationalVerificationForm, submitInternationalVerificationForm, updateVerificationFormLocalData, getIntlWireVerificationView, InternationalWireVerificationView, };
|
|
834
834
|
export { fetchExpressPayInitialDetails, updateExpressPayFormLocalData, submitExpressPay, resetExpressPayLocalData, ExpressPayFormLocalData, ExpressPayView, getExpressPayView, };
|
|
835
|
-
export { acceptTreasuryTerms, fetchTreasurySetupView, clearTreasurySetupView, fetchTreasuryFunds, updatePortfolioAllocation, fetchPortfolioAllocation, updateFundAllocationLocalData, FundAllocationOption, FundComposition, FundData, TreasurySetupView, getTreasurySetupViewDetails, };
|
|
835
|
+
export { acceptTreasuryTerms, fetchTreasurySetupView, clearTreasurySetupView, fetchTreasuryFunds, updatePortfolioAllocation, fetchPortfolioAllocation, updateFundAllocationLocalData, FundAllocationOption, FundComposition, FundData, TreasurySetupView, getTreasurySetupViewDetails, getTreasuryFundsMaximumYield, };
|
|
836
836
|
export { fetchChatSessionsForUser, createSession, submitQuestion, updateAiCfoViewScrollPosition, updateCurrentInput, clearInput, setSession, clearAiCfoView, clearCurrentSessionId, createSessionAndSubmit, stopSubmit, stopSubmitQuestion, fetchChatHistory, updateResponseState, } from './view/aiCfoView/aiCfoViewReducer';
|
|
837
837
|
export { AiCfoViewState, AiCfoViewUIState, } from './view/aiCfoView/aiCfoViewState';
|
|
838
838
|
export { AiCfoViewSelector, getAiCfoView, } from './view/aiCfoView/aiCfoViewSelector';
|
package/lib/index.js
CHANGED
|
@@ -64,8 +64,8 @@ exports.resetSelectedJEAccruedScheduleKey = exports.updateSelectedJEAccruedSched
|
|
|
64
64
|
exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewAttachments = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewAttachmentView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getVendorTabView = exports.updateVendorTabViewTab = 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.updateAccruedJEScheduleAccruedByListKey = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getAccruedScheduleDetailsView = 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.fetchAccruedScheduleList = exports.fetchScheduleList = exports.getAccruedScheduleListReport = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.resetAccruedDetailNewScheduleState = void 0;
|
|
65
65
|
exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_GROUP_BY_CATEGORIES = 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.updateVendorGlobalReviewViewLocalData = 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.getVendorDetailSelectorView = exports.saveVendorDetailsView = exports.updateReviewVendorDetailLocalData = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = void 0;
|
|
66
66
|
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.saveReasonForAuditRule = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getUserFromAllUsers = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.clearCardPaymentView = exports.resetCardPaymentErrorStatuses = exports.fetchPaymentSources = exports.addCardPaymentSource = exports.confirmCardSetupIntent = exports.createCardSetupIntent = exports.getAllCardsAndBankPaymentMethods = exports.deleteTag = exports.createTag = exports.fetchTagList = exports.getAllTags = exports.initialTaskDetailLocalData = exports.convertHHMMStrToMinutes = exports.updateTaskFromListView = exports.toDueDateGroupKeyType = exports.toTaskStatusCodeType = exports.toPriorityCodeType = exports.getDueDateValueFromDueDateGroupId = exports.initialTaskDetail = exports.fetchAllTaskGroups = exports.getTaskUpdates = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.updateTaskGroupName = exports.dragNDropTasks = exports.updateTaskListLocalData = exports.deleteTaskGroup = exports.initiateTaskListLocalData = exports.createNewTaskGroup = exports.bulkUpdateTaskList = void 0;
|
|
67
|
-
exports.
|
|
68
|
-
exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setSessions = exports.setNewSession = exports.getAiCfoView = exports.updateResponseState = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = void 0;
|
|
67
|
+
exports.fetchChatSessionsForUser = exports.getTreasuryFundsMaximumYield = exports.getTreasurySetupViewDetails = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = exports.submitInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.createTaskFromTaskGroupTemplate = exports.getCompanyTaskManagerView = exports.fetchCompanyTaskManagerView = exports.getMinAllowedEndDate = exports.toRecurringFrequency = exports.getRecurringEndDateFromCount = exports.updateReferViewed = 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 = void 0;
|
|
68
|
+
exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setSessions = exports.setNewSession = exports.getAiCfoView = exports.updateResponseState = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = void 0;
|
|
69
69
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
70
70
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
71
71
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -1553,6 +1553,8 @@ Object.defineProperty(exports, "updatePortfolioAllocation", { enumerable: true,
|
|
|
1553
1553
|
const treasurySetupViewSelector_1 = require("./view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector");
|
|
1554
1554
|
Object.defineProperty(exports, "getTreasuryBusinessVerificationDetails", { enumerable: true, get: function () { return treasurySetupViewSelector_1.getTreasuryBusinessVerificationDetails; } });
|
|
1555
1555
|
Object.defineProperty(exports, "getTreasurySetupViewDetails", { enumerable: true, get: function () { return treasurySetupViewSelector_1.getTreasurySetupViewDetails; } });
|
|
1556
|
+
const treasurySetupViewState_1 = require("./view/spendManagement/treasury/treasurySetUp/treasurySetupViewState");
|
|
1557
|
+
Object.defineProperty(exports, "getTreasuryFundsMaximumYield", { enumerable: true, get: function () { return treasurySetupViewState_1.getTreasuryFundsMaximumYield; } });
|
|
1556
1558
|
const checkDepositReducer_1 = require("./view/spendManagement/zeniAccounts/checkDeposit/checkDepositReducer");
|
|
1557
1559
|
Object.defineProperty(exports, "clearCheckDeposit", { enumerable: true, get: function () { return checkDepositReducer_1.clearCheckDeposit; } });
|
|
1558
1560
|
Object.defineProperty(exports, "depositCheck", { enumerable: true, get: function () { return checkDepositReducer_1.depositCheck; } });
|
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
3
4
|
import { RootState } from '../../../../../reducer';
|
|
4
5
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
6
|
import { updatePortfolioAllocation, updatePortfolioAllocationFailure, updatePortfolioAllocationSuccess } from '../treasurySetupViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof updatePortfolioAllocation> | ReturnType<typeof updatePortfolioAllocationSuccess> | ReturnType<typeof updatePortfolioAllocationFailure>;
|
|
7
|
+
export type ActionType = ReturnType<typeof updatePortfolioAllocation> | ReturnType<typeof updatePortfolioAllocationSuccess> | ReturnType<typeof updatePortfolioAllocationFailure> | ReturnType<typeof openSnackbar>;
|
|
7
8
|
export declare const updatePortfolioAllocationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updatePortfolioAllocationEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
6
7
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
8
|
const treasurySetupViewReducer_1 = require("../treasurySetupViewReducer");
|
|
8
9
|
const updatePortfolioAllocationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasurySetupViewReducer_1.updatePortfolioAllocation.match), (0, operators_1.switchMap)((action) => {
|
|
@@ -17,7 +18,15 @@ const updatePortfolioAllocationEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
17
18
|
: zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/treasury-account`, payload);
|
|
18
19
|
return apiCall.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
20
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
20
|
-
|
|
21
|
+
const actions = [
|
|
22
|
+
(0, treasurySetupViewReducer_1.updatePortfolioAllocationSuccess)(response.data || { fund_allocation_percentages: {} }),
|
|
23
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
24
|
+
messageSection: 'treasury_update_portfolio_allocation',
|
|
25
|
+
messageText: 'success',
|
|
26
|
+
type: 'success',
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
29
|
+
return (0, rxjs_1.from)(actions);
|
|
21
30
|
}
|
|
22
31
|
else {
|
|
23
32
|
return (0, rxjs_1.of)((0, treasurySetupViewReducer_1.updatePortfolioAllocationFailure)(response.status));
|
|
@@ -44,7 +44,7 @@ interface AllocationPercentageToRiskPayload {
|
|
|
44
44
|
}
|
|
45
45
|
export type FetchTreasuryFundsResponse = ZeniAPIResponse<TreasuryFundsPayload>;
|
|
46
46
|
export interface UpdatePortfolioAllocationPayload {
|
|
47
|
-
|
|
47
|
+
fund_allocation_percentages: Record<string, number>;
|
|
48
48
|
}
|
|
49
49
|
export type UpdatePortfolioAllocationResponse = ZeniAPIResponse<UpdatePortfolioAllocationPayload>;
|
|
50
50
|
export interface FetchPortfolioAllocationPayload {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
|
-
import { TreasuryFundsPayload } from './treasurySetupViewPayload';
|
|
2
|
+
import { TreasuryFundsPayload, UpdatePortfolioAllocationPayload } from './treasurySetupViewPayload';
|
|
3
3
|
import { FundAllocationOption, TreasurySetupViewState } from './treasurySetupViewState';
|
|
4
4
|
export declare const initialState: TreasurySetupViewState;
|
|
5
5
|
export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchTreasuryFunds">, fetchTreasurySetupView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, refreshViewInBackground?: any], {
|
|
@@ -12,7 +12,7 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
|
|
|
12
12
|
error: ZeniAPIStatus;
|
|
13
13
|
}, "treasurySetupView/updateTreasuryFundsFailure">, updatePortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isEdit: boolean], {
|
|
14
14
|
isEdit: boolean;
|
|
15
|
-
}, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").
|
|
15
|
+
}, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
16
|
allocation_percentages: Record<string, number>;
|
|
17
17
|
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">;
|
|
18
18
|
declare const _default: import("redux").Reducer<TreasurySetupViewState>;
|
|
@@ -177,11 +177,28 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
|
|
|
177
177
|
};
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
|
-
updatePortfolioAllocationSuccess(draft) {
|
|
180
|
+
updatePortfolioAllocationSuccess(draft, action) {
|
|
181
181
|
draft.portfolioAllocationUpdateStatus = {
|
|
182
182
|
fetchState: 'Completed',
|
|
183
183
|
error: undefined,
|
|
184
184
|
};
|
|
185
|
+
// Update currentAllocation with the response data
|
|
186
|
+
draft.currentAllocation = {
|
|
187
|
+
fetchStatus: {
|
|
188
|
+
fetchState: 'Completed',
|
|
189
|
+
error: undefined,
|
|
190
|
+
},
|
|
191
|
+
allocation: action.payload.fund_allocation_percentages,
|
|
192
|
+
};
|
|
193
|
+
// Update fundAllocationLocalData to match the current allocation
|
|
194
|
+
const matchingOption = draft.treasuryFundsDetails.fundAllocationOptions.find((option) => (0, isEqual_1.default)(option.allocation, action.payload.fund_allocation_percentages));
|
|
195
|
+
if (matchingOption) {
|
|
196
|
+
draft.fundAllocationLocalData = {
|
|
197
|
+
allocation: matchingOption.allocation,
|
|
198
|
+
riskLevel: matchingOption.riskLevel,
|
|
199
|
+
optionIndex: matchingOption.optionIndex,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
185
202
|
},
|
|
186
203
|
updatePortfolioAllocationFailure: {
|
|
187
204
|
reducer(draft, action) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.liquidityTimelineCodeToValue = void 0;
|
|
4
|
+
exports.getTreasuryFundsMaximumYield = getTreasuryFundsMaximumYield;
|
|
4
5
|
const liquidityTimelineCodeToValue = (code) => {
|
|
5
6
|
switch (code) {
|
|
6
7
|
case 'same-day':
|
|
@@ -12,3 +13,9 @@ const liquidityTimelineCodeToValue = (code) => {
|
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
15
|
exports.liquidityTimelineCodeToValue = liquidityTimelineCodeToValue;
|
|
16
|
+
function getTreasuryFundsMaximumYield(funds) {
|
|
17
|
+
if (funds.length === 0) {
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
return Math.max(...funds.map((fund) => fund.yield));
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.54",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|