@zeniai/client-epic-state 5.0.65-betaRR6 → 5.0.65
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/aiCfo/aiCfoPayload.d.ts +1 -168
- package/lib/entity/aiCfo/aiCfoReducer.js +2 -186
- package/lib/entity/aiCfo/aiCfoState.d.ts +4 -164
- package/lib/entity/aiCfo/aiCfoState.js +1 -10
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -6
- package/lib/entity/tenant/clearAllEpic.js +0 -8
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +1 -9
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +3 -187
- package/lib/esm/entity/aiCfo/aiCfoState.js +0 -7
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -8
- package/lib/esm/epic.js +1 -9
- package/lib/esm/index.js +3 -17
- package/lib/esm/reducer.js +0 -12
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -25
- package/lib/index.d.ts +3 -16
- package/lib/index.js +11 -99
- package/lib/reducer.d.ts +0 -12
- package/lib/reducer.js +0 -12
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +0 -7
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +1 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -1
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -27
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +0 -176
- package/lib/entity/cardPolicy/cardPolicyPayload.js +0 -112
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +0 -13
- package/lib/entity/cardPolicy/cardPolicyReducer.js +0 -203
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +0 -28
- package/lib/entity/cardPolicy/cardPolicySelector.js +0 -86
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +0 -172
- package/lib/entity/cardPolicy/cardPolicyState.js +0 -14
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +0 -18
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -54
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +0 -26
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -47
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +0 -101
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +0 -199
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +0 -66
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +0 -9
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -50
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -43
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -70
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -56
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -49
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -42
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -72
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -21
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -56
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -50
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -6
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -74
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +0 -21
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -28
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -60
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +0 -18
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -53
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +0 -16
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -46
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -76
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +0 -21
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -27
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -60
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -54
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +0 -4
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -10
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -29
|
@@ -92,13 +92,6 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
92
92
|
questionAnswerId: ID;
|
|
93
93
|
}, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
94
|
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
95
|
-
/**
|
|
96
|
-
* AI Card Creation flow: when true, the epic appends `&no_card_created=true`
|
|
97
|
-
* so the backend tailors prompts for a tenant that has not yet created a
|
|
98
|
-
* card. The bucket key is unchanged (`pageContext`); see
|
|
99
|
-
* `useFetchSuggestedQuestionsWhenReady` for the refetch-on-flag-flip rule.
|
|
100
|
-
*/
|
|
101
|
-
noCardCreated?: boolean;
|
|
102
95
|
}, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
103
96
|
generatedAt: string;
|
|
104
97
|
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
@@ -4,12 +4,5 @@ import { RootState } from '../../../reducer';
|
|
|
4
4
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
5
|
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
|
|
6
6
|
export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
|
|
7
|
-
/**
|
|
8
|
-
* GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=...
|
|
9
|
-
*
|
|
10
|
-
* Appends `&no_card_created=true` when the action payload sets
|
|
11
|
-
* `noCardCreated: true` (AI Card Creation flow on the cards list — the tenant
|
|
12
|
-
* has not yet created any card). Any other value omits the flag entirely so
|
|
13
|
-
* the existing call sites continue to issue the unchanged request.
|
|
14
|
-
*/
|
|
7
|
+
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
15
8
|
export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,23 +5,13 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../responsePayload");
|
|
7
7
|
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
-
/**
|
|
9
|
-
* GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=...
|
|
10
|
-
*
|
|
11
|
-
* Appends `&no_card_created=true` when the action payload sets
|
|
12
|
-
* `noCardCreated: true` (AI Card Creation flow on the cards list — the tenant
|
|
13
|
-
* has not yet created any card). Any other value omits the flag entirely so
|
|
14
|
-
* the existing call sites continue to issue the unchanged request.
|
|
15
|
-
*/
|
|
8
|
+
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
16
9
|
const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
|
|
17
10
|
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
18
11
|
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
19
12
|
(0, operators_1.mergeMap)((action) => {
|
|
20
|
-
const { pageContext
|
|
13
|
+
const { pageContext } = action.payload;
|
|
21
14
|
const query = new URLSearchParams({ page_context: pageContext });
|
|
22
|
-
if (noCardCreated === true) {
|
|
23
|
-
query.set('no_card_created', 'true');
|
|
24
|
-
}
|
|
25
15
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
26
16
|
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
27
17
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
@@ -13,7 +13,7 @@ declare const toFrequencyLabelType: (v: string) => "High" | "Low" | "Very Low" |
|
|
|
13
13
|
type FrequencyLabelType = ReturnType<typeof toFrequencyLabelType>;
|
|
14
14
|
declare const toFrequencyValueType: (v: string) => "high" | "low" | "very_low" | "mid" | "very_high";
|
|
15
15
|
type FrequencyValueType = ReturnType<typeof toFrequencyValueType>;
|
|
16
|
-
declare const toProductServiceKeyType: (v: string) => "reimbursement" | "
|
|
16
|
+
declare const toProductServiceKeyType: (v: string) => "reimbursement" | "accounts" | "cards" | "billpay" | "zeni_tax_plan" | "cfo_plan" | "payroll_manager_service_plan";
|
|
17
17
|
export type ProductServiceKey = ReturnType<typeof toProductServiceKeyType>;
|
|
18
18
|
export type CompanyHealthMetricDropDownOption = {
|
|
19
19
|
label: FrequencyLabelType;
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
38
38
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
39
39
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
40
40
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
41
|
-
messageSection: "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" | "
|
|
41
|
+
messageSection: "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" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "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" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "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" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
|
|
42
42
|
messageText: "notification" | "failed" | "success";
|
|
43
43
|
type: "error" | "success" | "info";
|
|
44
44
|
variables: {
|
|
@@ -6,7 +6,7 @@ import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
|
6
6
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
7
7
|
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
|
-
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "
|
|
9
|
+
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
|
|
10
10
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
11
11
|
export declare const toJEScheduleMainTab: (v: string) => "completed" | "pending_review" | "ongoing";
|
|
12
12
|
export type JEScheduleMainTab = ReturnType<typeof toJEScheduleMainTab>;
|
|
@@ -2,7 +2,7 @@ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { CompletedSubTab } from './completedSubTab';
|
|
5
|
-
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "
|
|
5
|
+
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
6
6
|
export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
|
|
7
7
|
export interface MissingReceiptsViewUIState {
|
|
8
8
|
scrollPosition: {
|
|
@@ -34,7 +34,7 @@ export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatch
|
|
|
34
34
|
export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
|
|
35
35
|
export declare const toMatchSource: (v: string) => "manual" | "ai";
|
|
36
36
|
export type MatchSource = ReturnType<typeof toMatchSource>;
|
|
37
|
-
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "
|
|
37
|
+
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
38
38
|
export type BulkUploadSortKey = ReturnType<typeof toBulkUploadSortKey>;
|
|
39
39
|
export interface CandidateRef {
|
|
40
40
|
matchScore: number;
|
|
@@ -18,7 +18,7 @@ import { ZeniDate } from '../../../zeniDayJS';
|
|
|
18
18
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
19
19
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
20
|
import { CompletedSubTab } from './completedSubTab';
|
|
21
|
-
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "
|
|
21
|
+
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
22
22
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
23
23
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
24
24
|
export declare const toTransactionsTabKey: (v: string) => "review" | "autoCategorized";
|
|
@@ -3,7 +3,7 @@ import { CompanyWithSchema } from '../../../../entity/company/companySelector';
|
|
|
3
3
|
import { OnboardingCustomerInfo } from '../../../../entity/onboardingCustomer/onboardingCustomerState';
|
|
4
4
|
import { Tenant } from '../../../../entity/tenant/tenantState';
|
|
5
5
|
import { CompanyDetailsLocalData, PrimaryContactLocalData } from '../../../spendManagement/commonSetup/setupViewState';
|
|
6
|
-
declare const toProductGroupType: (v: string) => "
|
|
6
|
+
declare const toProductGroupType: (v: string) => "other" | "bookkeeping" | "banking" | "spend_management" | "cards";
|
|
7
7
|
export type ProductGroupType = ReturnType<typeof toProductGroupType>;
|
|
8
8
|
export declare const toProductType: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax";
|
|
9
9
|
export declare const toProductTypeStrict: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax" | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "role" | "manager" | "name" | "department" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -54,21 +54,7 @@ export interface MyPendingActivationChargeCardListSelectorView extends SelectorV
|
|
|
54
54
|
export interface ChargeCardListWithShippingAddressSelectorView extends SelectorView {
|
|
55
55
|
cards: ChargeCardWithUserAndShippingAddress[];
|
|
56
56
|
}
|
|
57
|
-
export interface AllChargeCardsWithUserSelectorView extends SelectorView {
|
|
58
|
-
cards: ChargeCardWithUser[];
|
|
59
|
-
}
|
|
60
57
|
export declare const getChargeCardListView: (state: RootState, includeCreditAccountDebitSummaryAndCashbackInfo: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean) => ChargeCardListSelectorView;
|
|
61
|
-
/**
|
|
62
|
-
* Returns every enriched `ChargeCardWithUser` for the tenant, without
|
|
63
|
-
* applying the cards-list screen's `searchText` filter or its column
|
|
64
|
-
* `sortKey/sortOrder`. Used by surfaces that need the raw card universe
|
|
65
|
-
* decoupled from whatever the user has typed/sorted on the cards list
|
|
66
|
-
* (e.g. the Card Policy "Apply to Cards" picker, which owns its own
|
|
67
|
-
* search + sort UI). The list-screen's filter/sort state is intentionally
|
|
68
|
-
* left untouched so revisits to the cards list still restore the user's
|
|
69
|
-
* search.
|
|
70
|
-
*/
|
|
71
|
-
export declare const getAllChargeCardsWithUser: (state: RootState) => AllChargeCardsWithUserSelectorView;
|
|
72
58
|
export declare const getMyPendingActivationChargeCardListView: (state: RootState) => MyPendingActivationChargeCardListSelectorView;
|
|
73
59
|
export declare const getMyRequestOnHoldChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView;
|
|
74
60
|
/**
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getChargeCardBulkActionView = exports.getChargeCardRowActionView = exports.getChargeCardRecurringExpensesByCardIds = exports.getDebitCardSummary = exports.getDebitCardList = exports.getDepositAccountListWithDebitCardIssued = exports.getCreditAccountDetails = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.
|
|
6
|
+
exports.getChargeCardBulkActionView = exports.getChargeCardRowActionView = exports.getChargeCardRecurringExpensesByCardIds = exports.getDebitCardSummary = exports.getDebitCardList = exports.getDepositAccountListWithDebitCardIssued = exports.getCreditAccountDetails = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getChargeCardListView = void 0;
|
|
7
7
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
9
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
@@ -94,32 +94,6 @@ const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbac
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
exports.getChargeCardListView = getChargeCardListView;
|
|
97
|
-
/**
|
|
98
|
-
* Returns every enriched `ChargeCardWithUser` for the tenant, without
|
|
99
|
-
* applying the cards-list screen's `searchText` filter or its column
|
|
100
|
-
* `sortKey/sortOrder`. Used by surfaces that need the raw card universe
|
|
101
|
-
* decoupled from whatever the user has typed/sorted on the cards list
|
|
102
|
-
* (e.g. the Card Policy "Apply to Cards" picker, which owns its own
|
|
103
|
-
* search + sort UI). The list-screen's filter/sort state is intentionally
|
|
104
|
-
* left untouched so revisits to the cards list still restore the user's
|
|
105
|
-
* search.
|
|
106
|
-
*/
|
|
107
|
-
const getAllChargeCardsWithUser = (state) => {
|
|
108
|
-
const { chargeCardListState, chargeCardState, chargeCardConfigState } = state;
|
|
109
|
-
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
110
|
-
const chargeCardsWithUser = getChargeCardsWithUser(cards, state);
|
|
111
|
-
const fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
112
|
-
chargeCardListState,
|
|
113
|
-
chargeCardConfigState,
|
|
114
|
-
]).fetchState;
|
|
115
|
-
return {
|
|
116
|
-
fetchState,
|
|
117
|
-
error: chargeCardListState.error,
|
|
118
|
-
cards: chargeCardsWithUser,
|
|
119
|
-
version: '1.0',
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
exports.getAllChargeCardsWithUser = getAllChargeCardsWithUser;
|
|
123
97
|
const getMyPendingActivationChargeCardListView = (state) => {
|
|
124
98
|
const { tenantState, chargeCardListState, chargeCardState } = state;
|
|
125
99
|
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
@@ -14,7 +14,7 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
14
14
|
archived?: TaskPayload[];
|
|
15
15
|
deleted?: TaskPayload[];
|
|
16
16
|
snoozed?: TaskPayload[];
|
|
17
|
-
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "
|
|
17
|
+
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "live" | "archived" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
18
|
fetchState: FetchState;
|
|
19
19
|
error?: ZeniAPIStatus;
|
|
20
20
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.65
|
|
3
|
+
"version": "5.0.65",
|
|
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
|
"module": "lib/esm/index.js",
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
-
import { CardPolicyStats, CardPolicyTemplate, CardPolicyTemplateEntityList, CardPolicyTemplateMode, CardPolicyTemplateSpendLimits, ExtractedCardPolicyRules, MccCategory } from './cardPolicyState';
|
|
4
|
-
export interface MccCategoryPayload {
|
|
5
|
-
count: number;
|
|
6
|
-
mcc_codes: string[];
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Wire shape for `GET /cards/1.0/cards/mcc-codes`. Beyond the universe of
|
|
11
|
-
* MCC categories used to populate the category search dropdown, the
|
|
12
|
-
* endpoint also ships **suggested** allow / block merchants and categories
|
|
13
|
-
* that the chip-pickers seed into their cloud body before the user starts
|
|
14
|
-
* editing.
|
|
15
|
-
*
|
|
16
|
-
* Field spellings (`*_catagories`) preserve the BE wire format verbatim;
|
|
17
|
-
* the camelCase mapper below corrects to `Categories`.
|
|
18
|
-
*/
|
|
19
|
-
export interface CardPolicyMccCategoriesPayload {
|
|
20
|
-
categories: MccCategoryPayload[];
|
|
21
|
-
suggested_allow_catagories?: MccCategoryPayload[];
|
|
22
|
-
suggested_allow_merchants?: string[];
|
|
23
|
-
suggested_block_catagories?: MccCategoryPayload[];
|
|
24
|
-
suggested_block_merchants?: string[];
|
|
25
|
-
}
|
|
26
|
-
export type CardPolicyMccCategoriesResponse = ZeniAPIResponse<CardPolicyMccCategoriesPayload>;
|
|
27
|
-
export declare const toMccCategory: (payload: MccCategoryPayload) => MccCategory;
|
|
28
|
-
/**
|
|
29
|
-
* Vendor row returned by `/accounting/1.0/vendors`. The card-policy
|
|
30
|
-
* vendor search dropdown only needs `vendor_id` + `vendor_name`; we
|
|
31
|
-
* deliberately ignore the rest of the payload to keep this slice
|
|
32
|
-
* independent of the heavy `vendor` entity store.
|
|
33
|
-
*/
|
|
34
|
-
export interface CardPolicyVendorSearchVendorPayload {
|
|
35
|
-
vendor_id: string;
|
|
36
|
-
vendor_name: string;
|
|
37
|
-
}
|
|
38
|
-
export interface CardPolicyVendorSearchData {
|
|
39
|
-
vendors: CardPolicyVendorSearchVendorPayload[];
|
|
40
|
-
}
|
|
41
|
-
export type CardPolicyVendorSearchResponse = ZeniAPIResponse<CardPolicyVendorSearchData>;
|
|
42
|
-
export interface CardPolicyVendorSearchOption {
|
|
43
|
-
name: string;
|
|
44
|
-
vendorId: string;
|
|
45
|
-
}
|
|
46
|
-
export declare const toCardPolicyVendorSearchOption: (payload: CardPolicyVendorSearchVendorPayload) => CardPolicyVendorSearchOption;
|
|
47
|
-
interface CardPolicyTemplateEntityListPayload {
|
|
48
|
-
category_codes: string[];
|
|
49
|
-
merchant_names: string[];
|
|
50
|
-
}
|
|
51
|
-
interface CardPolicyTemplateSpendLimitsPayload {
|
|
52
|
-
transaction: number | null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Request body for `POST /cards/1.0/policy-templates`. Consumers pass the
|
|
56
|
-
* already-camelCased payload to the action creator; the epic re-maps it to
|
|
57
|
-
* the snake_case wire format before sending.
|
|
58
|
-
*/
|
|
59
|
-
export interface CreateCardPolicyTemplateRequest {
|
|
60
|
-
allowedEntity: CardPolicyTemplateEntityList;
|
|
61
|
-
applyToCards: ID[];
|
|
62
|
-
blockedEntity: CardPolicyTemplateEntityList;
|
|
63
|
-
description: string;
|
|
64
|
-
mode: CardPolicyTemplateMode;
|
|
65
|
-
name: string;
|
|
66
|
-
/**
|
|
67
|
-
* `null` indicates the require-receipt toggle is off (no threshold
|
|
68
|
-
* configured). The BE accepts `null` and treats it as "no requirement";
|
|
69
|
-
* `0` means the user explicitly entered zero with the toggle on.
|
|
70
|
-
*/
|
|
71
|
-
requiredReceiptThreshold: number | null;
|
|
72
|
-
spendLimits: CardPolicyTemplateSpendLimits;
|
|
73
|
-
}
|
|
74
|
-
export interface CreateCardPolicyTemplateRequestBody {
|
|
75
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
76
|
-
apply_to_cards: ID[];
|
|
77
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
78
|
-
description: string;
|
|
79
|
-
mode: string;
|
|
80
|
-
name: string;
|
|
81
|
-
required_receipt_threshold: number | null;
|
|
82
|
-
spend_limits: CardPolicyTemplateSpendLimitsPayload;
|
|
83
|
-
}
|
|
84
|
-
export interface CardPolicyTemplatePayload {
|
|
85
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
86
|
-
applied_cards: ID[];
|
|
87
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
88
|
-
cards_count: number;
|
|
89
|
-
category_restrictions: unknown[];
|
|
90
|
-
created_at: string;
|
|
91
|
-
created_by: ID;
|
|
92
|
-
description: string;
|
|
93
|
-
mode: string;
|
|
94
|
-
name: string;
|
|
95
|
-
required_receipt_threshold: number | null;
|
|
96
|
-
spend_limits: CardPolicyTemplateSpendLimitsPayload;
|
|
97
|
-
status: string;
|
|
98
|
-
template_id: ID;
|
|
99
|
-
tenant_id: ID;
|
|
100
|
-
updated_at: string;
|
|
101
|
-
}
|
|
102
|
-
export interface CreateCardPolicyTemplateResponseData {
|
|
103
|
-
cards_applied: number;
|
|
104
|
-
template: CardPolicyTemplatePayload;
|
|
105
|
-
}
|
|
106
|
-
export type CreateCardPolicyTemplateResponse = ZeniAPIResponse<CreateCardPolicyTemplateResponseData>;
|
|
107
|
-
export type UpdateCardPolicyTemplateRequest = CreateCardPolicyTemplateRequest;
|
|
108
|
-
export type UpdateCardPolicyTemplateRequestBody = CreateCardPolicyTemplateRequestBody;
|
|
109
|
-
export type UpdateCardPolicyTemplateResponseData = CreateCardPolicyTemplateResponseData;
|
|
110
|
-
export type UpdateCardPolicyTemplateResponse = CreateCardPolicyTemplateResponse;
|
|
111
|
-
export type CardPolicyDetailResponseData = CreateCardPolicyTemplateResponseData;
|
|
112
|
-
export type CardPolicyDetailResponse = CreateCardPolicyTemplateResponse;
|
|
113
|
-
/**
|
|
114
|
-
* Aggregate counters returned alongside the templates list. Stored on
|
|
115
|
-
* the entity slice (alongside `cardPolicyTemplateById`) so any list
|
|
116
|
-
* surface can read it without re-fetching.
|
|
117
|
-
*/
|
|
118
|
-
export interface CardPolicyStatsPayload {
|
|
119
|
-
active_policies: number;
|
|
120
|
-
total_cards: number;
|
|
121
|
-
total_templates: number;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Each list row is wrapped in the same `{cards_applied, template}`
|
|
125
|
-
* envelope the create endpoint returns. Only the `template` portion is
|
|
126
|
-
* stored on the entity slice; `cards_applied` is a one-shot summary
|
|
127
|
-
* carried over from create and not surfaced in the list state today.
|
|
128
|
-
*/
|
|
129
|
-
export interface CardPolicyListRowPayload {
|
|
130
|
-
data: CreateCardPolicyTemplateResponseData;
|
|
131
|
-
}
|
|
132
|
-
export interface ListCardPolicyTemplatesResponseData {
|
|
133
|
-
stats: CardPolicyStatsPayload;
|
|
134
|
-
templates: CardPolicyListRowPayload[];
|
|
135
|
-
}
|
|
136
|
-
export type ListCardPolicyTemplatesResponse = ZeniAPIResponse<ListCardPolicyTemplatesResponseData>;
|
|
137
|
-
export declare const toCardPolicyStats: (payload: CardPolicyStatsPayload) => CardPolicyStats;
|
|
138
|
-
export declare const toCardPolicyTemplateList: (data: ListCardPolicyTemplatesResponseData) => CardPolicyTemplate[];
|
|
139
|
-
export declare const toCardPolicyTemplate: (payload: CardPolicyTemplatePayload) => CardPolicyTemplate;
|
|
140
|
-
/**
|
|
141
|
-
* Re-shape a camelCase create request into the snake_case wire body.
|
|
142
|
-
* Used by the epic at request time.
|
|
143
|
-
*/
|
|
144
|
-
export declare const toCreateCardPolicyTemplateRequestBody: (request: CreateCardPolicyTemplateRequest) => CreateCardPolicyTemplateRequestBody;
|
|
145
|
-
export declare const toUpdateCardPolicyTemplateRequestBody: (request: CreateCardPolicyTemplateRequest) => CreateCardPolicyTemplateRequestBody;
|
|
146
|
-
/**
|
|
147
|
-
* Seed an edit-form draft (`CreateCardPolicyTemplateRequest`) from an
|
|
148
|
-
* existing camelCased `CardPolicyTemplate`. Used by the detail-fetch
|
|
149
|
-
* epic so the edit page can render with the saved values pre-populated.
|
|
150
|
-
*/
|
|
151
|
-
export declare const toCardPolicyEditFormDraft: (template: CardPolicyTemplate) => CreateCardPolicyTemplateRequest;
|
|
152
|
-
/**
|
|
153
|
-
* Wire shape returned by `POST /cards/1.0/policy-documents/extract`.
|
|
154
|
-
* The backend OCRs / parses an uploaded policy document (PDF, image, etc.)
|
|
155
|
-
* and returns a best-effort set of policy rules + a confidence score.
|
|
156
|
-
*
|
|
157
|
-
* Consumers (manual `CardPolicyCreatePage` + AI CFO `CardPolicyInteractiveForm`)
|
|
158
|
-
* use `toExtractedCardPolicyRules` to map this onto the camelCase FE shape
|
|
159
|
-
* and then feed the result through `applyExtractedPolicyRulesToFormValues`
|
|
160
|
-
* (`@zeniai/web-components`) to seed the RHF form.
|
|
161
|
-
*/
|
|
162
|
-
export interface ExtractedCardPolicyRulesPayload {
|
|
163
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
164
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
165
|
-
confidence_score: number;
|
|
166
|
-
policy_name: string;
|
|
167
|
-
required_receipt_threshold: number;
|
|
168
|
-
transaction_limit: number;
|
|
169
|
-
}
|
|
170
|
-
export interface PolicyDocumentExtractResponseData {
|
|
171
|
-
extracted_rules: ExtractedCardPolicyRulesPayload;
|
|
172
|
-
message: string;
|
|
173
|
-
}
|
|
174
|
-
export type PolicyDocumentExtractResponse = ZeniAPIResponse<PolicyDocumentExtractResponseData>;
|
|
175
|
-
export declare const toExtractedCardPolicyRules: (payload: ExtractedCardPolicyRulesPayload) => ExtractedCardPolicyRules;
|
|
176
|
-
export {};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toExtractedCardPolicyRules = exports.toCardPolicyEditFormDraft = exports.toUpdateCardPolicyTemplateRequestBody = exports.toCreateCardPolicyTemplateRequestBody = exports.toCardPolicyTemplate = exports.toCardPolicyTemplateList = exports.toCardPolicyStats = exports.toCardPolicyVendorSearchOption = exports.toMccCategory = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
const cardPolicyState_1 = require("./cardPolicyState");
|
|
6
|
-
const toMccCategory = (payload) => ({
|
|
7
|
-
count: payload.count,
|
|
8
|
-
mccCodes: payload.mcc_codes ?? [],
|
|
9
|
-
name: payload.name,
|
|
10
|
-
});
|
|
11
|
-
exports.toMccCategory = toMccCategory;
|
|
12
|
-
const toCardPolicyVendorSearchOption = (payload) => ({
|
|
13
|
-
vendorId: payload.vendor_id,
|
|
14
|
-
name: payload.vendor_name,
|
|
15
|
-
});
|
|
16
|
-
exports.toCardPolicyVendorSearchOption = toCardPolicyVendorSearchOption;
|
|
17
|
-
const toCardPolicyStats = (payload) => ({
|
|
18
|
-
activePolicies: payload.active_policies,
|
|
19
|
-
totalCards: payload.total_cards,
|
|
20
|
-
totalTemplates: payload.total_templates,
|
|
21
|
-
});
|
|
22
|
-
exports.toCardPolicyStats = toCardPolicyStats;
|
|
23
|
-
const toCardPolicyTemplateList = (data) => (data.templates ?? []).map((row) => (0, exports.toCardPolicyTemplate)(row.data.template));
|
|
24
|
-
exports.toCardPolicyTemplateList = toCardPolicyTemplateList;
|
|
25
|
-
const toCardPolicyTemplateEntityList = (payload) => ({
|
|
26
|
-
categoryCodes: payload.category_codes ?? [],
|
|
27
|
-
merchantNames: payload.merchant_names ?? [],
|
|
28
|
-
});
|
|
29
|
-
const toCardPolicyTemplate = (payload) => ({
|
|
30
|
-
allowedEntity: toCardPolicyTemplateEntityList(payload.allowed_entity),
|
|
31
|
-
appliedCards: payload.applied_cards ?? [],
|
|
32
|
-
blockedEntity: toCardPolicyTemplateEntityList(payload.blocked_entity),
|
|
33
|
-
cardsCount: payload.cards_count,
|
|
34
|
-
categoryRestrictions: payload.category_restrictions ?? [],
|
|
35
|
-
createdAt: (0, zeniDayJS_1.date)(payload.created_at),
|
|
36
|
-
createdBy: payload.created_by,
|
|
37
|
-
description: payload.description,
|
|
38
|
-
mode: (0, cardPolicyState_1.toCardPolicyTemplateMode)(payload.mode),
|
|
39
|
-
name: payload.name,
|
|
40
|
-
requiredReceiptThreshold: payload.required_receipt_threshold,
|
|
41
|
-
spendLimits: {
|
|
42
|
-
transaction: payload.spend_limits.transaction,
|
|
43
|
-
},
|
|
44
|
-
status: (0, cardPolicyState_1.toCardPolicyTemplateStatus)(payload.status),
|
|
45
|
-
templateId: payload.template_id,
|
|
46
|
-
tenantId: payload.tenant_id,
|
|
47
|
-
updatedAt: (0, zeniDayJS_1.date)(payload.updated_at),
|
|
48
|
-
});
|
|
49
|
-
exports.toCardPolicyTemplate = toCardPolicyTemplate;
|
|
50
|
-
/**
|
|
51
|
-
* Re-shape a camelCase create request into the snake_case wire body.
|
|
52
|
-
* Used by the epic at request time.
|
|
53
|
-
*/
|
|
54
|
-
const toCreateCardPolicyTemplateRequestBody = (request) => ({
|
|
55
|
-
allowed_entity: {
|
|
56
|
-
category_codes: request.allowedEntity.categoryCodes,
|
|
57
|
-
merchant_names: request.allowedEntity.merchantNames,
|
|
58
|
-
},
|
|
59
|
-
apply_to_cards: request.applyToCards,
|
|
60
|
-
blocked_entity: {
|
|
61
|
-
category_codes: request.blockedEntity.categoryCodes,
|
|
62
|
-
merchant_names: request.blockedEntity.merchantNames,
|
|
63
|
-
},
|
|
64
|
-
description: request.description,
|
|
65
|
-
mode: request.mode ?? 'strict',
|
|
66
|
-
name: request.name,
|
|
67
|
-
required_receipt_threshold: request.requiredReceiptThreshold,
|
|
68
|
-
spend_limits: {
|
|
69
|
-
transaction: request.spendLimits.transaction,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
exports.toCreateCardPolicyTemplateRequestBody = toCreateCardPolicyTemplateRequestBody;
|
|
73
|
-
// Update body uses the exact same wire shape as create — the PUT
|
|
74
|
-
// endpoint is a full replace.
|
|
75
|
-
exports.toUpdateCardPolicyTemplateRequestBody = exports.toCreateCardPolicyTemplateRequestBody;
|
|
76
|
-
/**
|
|
77
|
-
* Seed an edit-form draft (`CreateCardPolicyTemplateRequest`) from an
|
|
78
|
-
* existing camelCased `CardPolicyTemplate`. Used by the detail-fetch
|
|
79
|
-
* epic so the edit page can render with the saved values pre-populated.
|
|
80
|
-
*/
|
|
81
|
-
const toCardPolicyEditFormDraft = (template) => ({
|
|
82
|
-
allowedEntity: {
|
|
83
|
-
categoryCodes: [...template.allowedEntity.categoryCodes],
|
|
84
|
-
merchantNames: [...template.allowedEntity.merchantNames],
|
|
85
|
-
},
|
|
86
|
-
applyToCards: [...template.appliedCards],
|
|
87
|
-
blockedEntity: {
|
|
88
|
-
categoryCodes: [...template.blockedEntity.categoryCodes],
|
|
89
|
-
merchantNames: [...template.blockedEntity.merchantNames],
|
|
90
|
-
},
|
|
91
|
-
description: template.description,
|
|
92
|
-
mode: template.mode,
|
|
93
|
-
name: template.name,
|
|
94
|
-
requiredReceiptThreshold: template.requiredReceiptThreshold,
|
|
95
|
-
spendLimits: { transaction: template.spendLimits.transaction },
|
|
96
|
-
});
|
|
97
|
-
exports.toCardPolicyEditFormDraft = toCardPolicyEditFormDraft;
|
|
98
|
-
const toExtractedCardPolicyRules = (payload) => ({
|
|
99
|
-
allowedEntity: {
|
|
100
|
-
categoryCodes: payload.allowed_entity?.category_codes ?? [],
|
|
101
|
-
merchantNames: payload.allowed_entity?.merchant_names ?? [],
|
|
102
|
-
},
|
|
103
|
-
blockedEntity: {
|
|
104
|
-
categoryCodes: payload.blocked_entity?.category_codes ?? [],
|
|
105
|
-
merchantNames: payload.blocked_entity?.merchant_names ?? [],
|
|
106
|
-
},
|
|
107
|
-
confidenceScore: payload.confidence_score,
|
|
108
|
-
policyName: payload.policy_name,
|
|
109
|
-
requiredReceiptThreshold: payload.required_receipt_threshold,
|
|
110
|
-
transactionLimit: payload.transaction_limit,
|
|
111
|
-
});
|
|
112
|
-
exports.toExtractedCardPolicyRules = toExtractedCardPolicyRules;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
-
import { CardPolicyMccCategoriesPayload, CardPolicyTemplatePayload, CardPolicyVendorSearchData, ExtractedCardPolicyRulesPayload } from './cardPolicyPayload';
|
|
3
|
-
import { CardPolicyState, CardPolicyStats, CardPolicyTemplate } from './cardPolicyState';
|
|
4
|
-
export declare const initialState: CardPolicyState;
|
|
5
|
-
export declare const fetchCardPolicyMccCategories: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/fetchCardPolicyMccCategories">, fetchCardPolicyVendorOptions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[searchString?: string | undefined], {
|
|
6
|
-
searchString: string;
|
|
7
|
-
}, "cardPolicy/fetchCardPolicyVendorOptions", never, never>, updateCardPolicyMccCategories: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyMccCategoriesPayload, "cardPolicy/updateCardPolicyMccCategories">, updateCardPolicyMccCategoriesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updateCardPolicyMccCategoriesFailure">, updateCardPolicyVendorOptions: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyVendorSearchData, "cardPolicy/updateCardPolicyVendorOptions">, updateCardPolicyVendorOptionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updateCardPolicyVendorOptionsFailure">, updateCreatedCardPolicyTemplate: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyTemplatePayload, "cardPolicy/updateCreatedCardPolicyTemplate">, updateCardPolicyTemplates: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyTemplate[], "cardPolicy/updateCardPolicyTemplates">, removeCardPolicyTemplate: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "cardPolicy/removeCardPolicyTemplate">, updateCardPolicyStats: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyStats, "cardPolicy/updateCardPolicyStats">, extractPolicyDocument: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[files: File[]], {
|
|
8
|
-
files: File[];
|
|
9
|
-
}, "cardPolicy/extractPolicyDocument", never, {
|
|
10
|
-
uploadedFileName: string;
|
|
11
|
-
}>, updatePolicyDocumentExtractionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<ExtractedCardPolicyRulesPayload, "cardPolicy/updatePolicyDocumentExtractionSuccess">, updatePolicyDocumentExtractionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updatePolicyDocumentExtractionFailure">, clearPolicyDocumentExtraction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/clearPolicyDocumentExtraction">, clearCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/clearCardPolicy">;
|
|
12
|
-
declare const _default: import("redux").Reducer<CardPolicyState>;
|
|
13
|
-
export default _default;
|