@zeniai/client-epic-state 5.0.55-betaML5 → 5.0.55-betaSS1
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/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/entity/account/accountSelector.d.ts +0 -9
- package/lib/entity/account/accountSelector.js +1 -14
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -4
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -10
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/esm/entity/account/accountSelector.js +0 -11
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -10
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +7 -6
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +3 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -8
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +71 -79
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -31
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +9 -0
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +0 -5
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +0 -10
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -24
- package/lib/index.d.ts +6 -5
- package/lib/index.js +37 -44
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +3 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -7
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +8 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -22
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +72 -80
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +3 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -32
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +2 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.js +13 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +24 -15
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -6
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +1 -2
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +0 -10
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -6
- package/lib/view/transactionDetail/transactionDetailSelector.js +1 -23
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +0 -81
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +0 -30
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +0 -34
|
@@ -26,13 +26,6 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
26
26
|
accountList.fetchState === 'Not-Started') {
|
|
27
27
|
updateActions.push((0, accountListReducer_1.fetchAccountList)('accountList', true));
|
|
28
28
|
}
|
|
29
|
-
const { transferAccounts, creditCardAccountsForTransfer, } = state$.value.expenseAutomationTransactionsViewState;
|
|
30
|
-
if (transferAccounts.fetchState === 'Not-Started') {
|
|
31
|
-
updateActions.push((0, transactionsViewReducer_1.fetchAccountsForTransferFlow)({ kind: 'transfer_eligible' }));
|
|
32
|
-
}
|
|
33
|
-
if (creditCardAccountsForTransfer.fetchState === 'Not-Started') {
|
|
34
|
-
updateActions.push((0, transactionsViewReducer_1.fetchAccountsForTransferFlow)({ kind: 'credit_card_only' }));
|
|
35
|
-
}
|
|
36
29
|
const classList = state$.value.classListState;
|
|
37
30
|
if (classList.hasValidState() === false &&
|
|
38
31
|
classList.fetchState === 'Not-Started') {
|
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" | "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" | "
|
|
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: {
|
|
@@ -2,6 +2,7 @@ import { EntityRecommendationPayload } from '../../../commonPayloadTypes/recomme
|
|
|
2
2
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
3
3
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
4
4
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
+
import { CompletedSubTab } from '../types/completedSubTab';
|
|
5
6
|
export interface TransactionCategorizationQueryPayload {
|
|
6
7
|
auto_categorized: boolean;
|
|
7
8
|
end_date: string | null;
|
|
@@ -11,6 +12,13 @@ export interface TransactionCategorizationQueryPayload {
|
|
|
11
12
|
sort_by: string;
|
|
12
13
|
sort_order: string;
|
|
13
14
|
start_date: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Required. For the Completed (`auto_categorized=true`) listing, scopes the
|
|
17
|
+
* returned page + `total_count` to one of the Completed sub-tabs. For the
|
|
18
|
+
* Review listing it is forced to `'all'` to preserve parent-tab semantics
|
|
19
|
+
* on the backend.
|
|
20
|
+
*/
|
|
21
|
+
sub_tab: CompletedSubTab;
|
|
14
22
|
}
|
|
15
23
|
export interface TransactionCategorizationPayload {
|
|
16
24
|
next_page_token: string | null;
|
|
@@ -6,7 +6,8 @@ import type { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
|
6
6
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
7
7
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
8
8
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
9
|
-
import { type
|
|
9
|
+
import { type CompletedSubTab } from '../types/completedSubTab';
|
|
10
|
+
import { type BatchDetails, type BatchListItem, type BatchStatus, type BulkUploadResultsTab, type BulkUploadSortKey, type BulkUploadState, type ManualSearchResult, type MissingReceiptsViewState, type MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
10
11
|
export declare const getCompletedTransactionsCacheKey: (periodId: MonthYearPeriodId, sortKey: BulkUploadSortKey | undefined, sortOrder: SortOrder | undefined, subTab: CompletedSubTab) => string;
|
|
11
12
|
export declare const initialBulkUploadState: BulkUploadState;
|
|
12
13
|
export declare const initialState: MissingReceiptsViewState;
|
|
@@ -13,7 +13,7 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
|
13
13
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
14
14
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
15
15
|
import { UpdateTransactionCategorizationResponsePayload } from '../payload/transactionCategorizationPayload';
|
|
16
|
-
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState
|
|
16
|
+
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
17
17
|
export declare const initialTransactionTabViewState: TransactionsTabViewState;
|
|
18
18
|
export declare const initialState: TransactionsViewState;
|
|
19
19
|
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
@@ -65,7 +65,9 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
65
65
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
66
66
|
}, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
|
|
67
67
|
newSelectedTab: "review" | "autoCategorized";
|
|
68
|
-
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>,
|
|
68
|
+
}, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "manual" | "ai_accountant"], {
|
|
69
|
+
newSubTab: "all" | "manual" | "ai_accountant";
|
|
70
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
69
71
|
selectedTab: "review" | "autoCategorized";
|
|
70
72
|
fetchState: FetchState;
|
|
71
73
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
@@ -164,26 +166,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
164
166
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
165
167
|
period: TimePeriod;
|
|
166
168
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
167
|
-
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>,
|
|
168
|
-
kind: TransferAccountsFetchKind;
|
|
169
|
-
}, "expenseAutomationTransactionsView/fetchAccountsForTransferFlow">, updateAccountsForTransferFlow: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
170
|
-
accountIds: ID[];
|
|
171
|
-
kind: TransferAccountsFetchKind;
|
|
172
|
-
}, "expenseAutomationTransactionsView/updateAccountsForTransferFlow">, updateAccountsForTransferFlowFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
173
|
-
kind: TransferAccountsFetchKind;
|
|
174
|
-
}, "expenseAutomationTransactionsView/updateAccountsForTransferFlowFailure">, createTransferEntry: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string, creditAccountIntegrationId: string, debitAccountIntegrationId: string, memo: string, transactionType: string, sourceTransactionType: string], {
|
|
175
|
-
transactionId: string;
|
|
176
|
-
creditAccountIntegrationId: string;
|
|
177
|
-
debitAccountIntegrationId: string;
|
|
178
|
-
memo: string;
|
|
179
|
-
transactionType: string;
|
|
180
|
-
sourceTransactionType: string;
|
|
181
|
-
}, "expenseAutomationTransactionsView/createTransferEntry", never, never>, createTransferEntrySuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/createTransferEntrySuccess">, createTransferEntryFailure: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/createTransferEntryFailure">, resetCreateTransferEntryStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/resetCreateTransferEntryStatus">, createTransferEntryReplacedTransaction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[previousTransactionId: TransactionID, newTransactionId: TransactionID], {
|
|
182
|
-
newTransactionId: TransactionID;
|
|
183
|
-
previousTransactionId: TransactionID;
|
|
184
|
-
}, "expenseAutomationTransactionsView/createTransferEntryReplacedTransaction", never, never>, acknowledgeTransferEntryRouteReplacement: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationTransactionsView/acknowledgeTransferEntryRouteReplacement">, removeTransactionFromAllTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string], {
|
|
185
|
-
transactionId: string;
|
|
186
|
-
}, "expenseAutomationTransactionsView/removeTransactionFromAllTabs", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
169
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
187
170
|
selectedTab: "review" | "autoCategorized";
|
|
188
171
|
transactionId: string;
|
|
189
172
|
fetchStatus: FetchStateAndError;
|
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateTransactionCategorizationCompletedSubTab = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
11
11
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
12
12
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
13
13
|
const transactionCategorizationLocalDataHelper_1 = require("../helpers/transactionCategorizationLocalDataHelper");
|
|
14
|
-
const transactionsViewState_1 = require("../types/transactionsViewState");
|
|
15
14
|
exports.initialTransactionTabViewState = {
|
|
16
15
|
saveStatus: {
|
|
17
16
|
fetchState: 'Not-Started',
|
|
@@ -49,22 +48,40 @@ exports.initialTransactionTabViewState = {
|
|
|
49
48
|
selectedTransactionLineId: undefined,
|
|
50
49
|
};
|
|
51
50
|
exports.initialState = {
|
|
52
|
-
|
|
53
|
-
creditCardAccountsForTransfer: {
|
|
54
|
-
accountIds: [],
|
|
55
|
-
fetchState: 'Not-Started',
|
|
56
|
-
},
|
|
57
|
-
lastTransferEntryReplacement: undefined,
|
|
51
|
+
autoCategorizedSubTabCache: {},
|
|
58
52
|
selectedTransactionCategorizationTab: 'review',
|
|
53
|
+
selectedTransactionCategorizationCompletedSubTab: 'all',
|
|
59
54
|
transactionCategorizationView: {
|
|
60
55
|
review: { ...exports.initialTransactionTabViewState },
|
|
61
56
|
autoCategorized: { ...exports.initialTransactionTabViewState },
|
|
62
57
|
},
|
|
63
|
-
transferAccounts: {
|
|
64
|
-
accountIds: [],
|
|
65
|
-
fetchState: 'Not-Started',
|
|
66
|
-
},
|
|
67
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Capture the autoCategorized tab's current paginated dataset for a sub-tab.
|
|
61
|
+
* The mid-flight `'In-Progress'` state is normalised to `'Completed'` because
|
|
62
|
+
* the in-flight request is cancelled by `switchMap` in the fetch epic when the
|
|
63
|
+
* sub-tab changes — restoring `'In-Progress'` later would leave the UI stuck
|
|
64
|
+
* showing a phantom loading state with no fetch actually running. Length-zero
|
|
65
|
+
* datasets degrade to `'Not-Started'` so the next visit triggers a fresh
|
|
66
|
+
* fetch from page 1 instead of short-circuiting on stale empty caches.
|
|
67
|
+
*/
|
|
68
|
+
function snapshotAutoCategorizedTab(autoCat) {
|
|
69
|
+
const transactionIdsBySelectedPeriod = {
|
|
70
|
+
...autoCat.transactionIdsBySelectedPeriod,
|
|
71
|
+
};
|
|
72
|
+
const hasAnyLoadedRows = Object.values(transactionIdsBySelectedPeriod).some((ids) => ids.length > 0);
|
|
73
|
+
let normalisedFetchState = autoCat.fetchState;
|
|
74
|
+
if (normalisedFetchState === 'In-Progress') {
|
|
75
|
+
normalisedFetchState = hasAnyLoadedRows ? 'Completed' : 'Not-Started';
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
error: autoCat.error,
|
|
79
|
+
fetchState: normalisedFetchState,
|
|
80
|
+
pageToken: autoCat.uiState.pageToken,
|
|
81
|
+
totalCount: { ...autoCat.uiState.totalCount },
|
|
82
|
+
transactionIdsBySelectedPeriod,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
68
85
|
const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
69
86
|
name: 'expenseAutomationTransactionsView',
|
|
70
87
|
initialState: exports.initialState,
|
|
@@ -278,6 +295,48 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
278
295
|
return { payload: { newSelectedTab } };
|
|
279
296
|
},
|
|
280
297
|
},
|
|
298
|
+
updateTransactionCategorizationCompletedSubTab: {
|
|
299
|
+
reducer(draft, action) {
|
|
300
|
+
const { newSubTab } = action.payload;
|
|
301
|
+
const previousSubTab = draft.selectedTransactionCategorizationCompletedSubTab;
|
|
302
|
+
if (previousSubTab === newSubTab) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const autoCat = draft.transactionCategorizationView.autoCategorized;
|
|
306
|
+
// Snapshot the outgoing sub-tab so a future revisit can short-circuit
|
|
307
|
+
// the fetch epic (mirrors the parent-tab "don't refetch what's
|
|
308
|
+
// already cached" behaviour). Period-scoped data is preserved as-is
|
|
309
|
+
// because the snapshot itself is keyed only by sub-tab; the active
|
|
310
|
+
// tab's per-period maps remain the source of truth while live.
|
|
311
|
+
draft.autoCategorizedSubTabCache[previousSubTab] =
|
|
312
|
+
snapshotAutoCategorizedTab(autoCat);
|
|
313
|
+
const cached = draft.autoCategorizedSubTabCache[newSubTab];
|
|
314
|
+
if (cached != null) {
|
|
315
|
+
autoCat.uiState.pageToken = cached.pageToken;
|
|
316
|
+
autoCat.uiState.totalCount = { ...cached.totalCount };
|
|
317
|
+
autoCat.transactionIdsBySelectedPeriod = {
|
|
318
|
+
...cached.transactionIdsBySelectedPeriod,
|
|
319
|
+
};
|
|
320
|
+
autoCat.fetchState = cached.fetchState;
|
|
321
|
+
autoCat.error = cached.error;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
// Sub-tab has never been visited — clear the active slot so the
|
|
325
|
+
// view-epic's `fetchState === 'Not-Started' || transactionIds.length
|
|
326
|
+
// === 0` cache check falls through and triggers a fresh page-1
|
|
327
|
+
// fetch for the new dataset.
|
|
328
|
+
autoCat.uiState.pageToken = null;
|
|
329
|
+
autoCat.uiState.totalCount = {};
|
|
330
|
+
autoCat.transactionIdsBySelectedPeriod = {};
|
|
331
|
+
autoCat.fetchState = 'Not-Started';
|
|
332
|
+
autoCat.error = undefined;
|
|
333
|
+
}
|
|
334
|
+
draft.selectedTransactionCategorizationCompletedSubTab = newSubTab;
|
|
335
|
+
},
|
|
336
|
+
prepare(newSubTab) {
|
|
337
|
+
return { payload: { newSubTab } };
|
|
338
|
+
},
|
|
339
|
+
},
|
|
281
340
|
updateTransactionCategorization: {
|
|
282
341
|
reducer(draft, action) {
|
|
283
342
|
const selectedTab = action.payload.selectedTab;
|
|
@@ -819,74 +878,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
819
878
|
};
|
|
820
879
|
},
|
|
821
880
|
},
|
|
822
|
-
fetchAccountsForTransferFlow(draft, action) {
|
|
823
|
-
const slice = action.payload.kind === 'credit_card_only'
|
|
824
|
-
? draft.creditCardAccountsForTransfer
|
|
825
|
-
: draft.transferAccounts;
|
|
826
|
-
slice.fetchState = 'In-Progress';
|
|
827
|
-
},
|
|
828
|
-
updateAccountsForTransferFlow(draft, action) {
|
|
829
|
-
const slice = action.payload.kind === 'credit_card_only'
|
|
830
|
-
? draft.creditCardAccountsForTransfer
|
|
831
|
-
: draft.transferAccounts;
|
|
832
|
-
slice.fetchState = 'Completed';
|
|
833
|
-
slice.accountIds = action.payload.accountIds;
|
|
834
|
-
},
|
|
835
|
-
updateAccountsForTransferFlowFailure(draft, action) {
|
|
836
|
-
const slice = action.payload.kind === 'credit_card_only'
|
|
837
|
-
? draft.creditCardAccountsForTransfer
|
|
838
|
-
: draft.transferAccounts;
|
|
839
|
-
slice.fetchState = 'Error';
|
|
840
|
-
},
|
|
841
|
-
createTransferEntry: {
|
|
842
|
-
prepare(transactionId, creditAccountIntegrationId, debitAccountIntegrationId, memo, transactionType, sourceTransactionType) {
|
|
843
|
-
return {
|
|
844
|
-
payload: {
|
|
845
|
-
transactionId,
|
|
846
|
-
creditAccountIntegrationId,
|
|
847
|
-
debitAccountIntegrationId,
|
|
848
|
-
memo,
|
|
849
|
-
transactionType,
|
|
850
|
-
sourceTransactionType,
|
|
851
|
-
},
|
|
852
|
-
};
|
|
853
|
-
},
|
|
854
|
-
reducer(draft) {
|
|
855
|
-
draft.createTransferEntryStatus = 'In-Progress';
|
|
856
|
-
},
|
|
857
|
-
},
|
|
858
|
-
createTransferEntrySuccess(draft) {
|
|
859
|
-
draft.createTransferEntryStatus = 'Completed';
|
|
860
|
-
},
|
|
861
|
-
createTransferEntryFailure(draft) {
|
|
862
|
-
draft.createTransferEntryStatus = 'Error';
|
|
863
|
-
},
|
|
864
|
-
resetCreateTransferEntryStatus(draft) {
|
|
865
|
-
draft.createTransferEntryStatus = 'Not-Started';
|
|
866
|
-
},
|
|
867
|
-
createTransferEntryReplacedTransaction: {
|
|
868
|
-
prepare(previousTransactionId, newTransactionId) {
|
|
869
|
-
return { payload: { newTransactionId, previousTransactionId } };
|
|
870
|
-
},
|
|
871
|
-
reducer(draft, action) {
|
|
872
|
-
draft.lastTransferEntryReplacement = action.payload;
|
|
873
|
-
},
|
|
874
|
-
},
|
|
875
|
-
acknowledgeTransferEntryRouteReplacement(draft) {
|
|
876
|
-
draft.lastTransferEntryReplacement = undefined;
|
|
877
|
-
},
|
|
878
|
-
removeTransactionFromAllTabs: {
|
|
879
|
-
prepare(transactionId) {
|
|
880
|
-
return { payload: { transactionId } };
|
|
881
|
-
},
|
|
882
|
-
reducer(draft, action) {
|
|
883
|
-
const { transactionId } = action.payload;
|
|
884
|
-
for (const tab of transactionsViewState_1.TRANSACTIONS_TABS) {
|
|
885
|
-
(0, transactionCategorizationLocalDataHelper_1.removeTransactionFromTabView)(draft.transactionCategorizationView[tab], transactionId);
|
|
886
|
-
}
|
|
887
|
-
},
|
|
888
|
-
},
|
|
889
881
|
},
|
|
890
882
|
});
|
|
891
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.
|
|
883
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationCompletedSubTab = _a.updateTransactionCategorizationCompletedSubTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
892
884
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -2,7 +2,8 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { SupportedTransaction } from '../../../entity/transaction/transactionState';
|
|
5
|
-
import type {
|
|
5
|
+
import type { CompletedSubTab } from '../types/completedSubTab';
|
|
6
|
+
import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
6
7
|
export interface CompletedTransactionsSelectorData {
|
|
7
8
|
fetchState: FetchStateAndError;
|
|
8
9
|
nextPageToken: string | null;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import { CompletionStatusType,
|
|
3
|
+
import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
4
4
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
7
|
import { SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
8
8
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
9
9
|
import { ProjectListSelectorView } from '../../projectList/projectListSelector';
|
|
10
|
+
import { CompletedSubTab } from '../types/completedSubTab';
|
|
10
11
|
import { TransactionReviewLocalData, TransactionsTab, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
11
12
|
export interface TransactionReviewLocalDataSelectorView {
|
|
12
13
|
transactionId: ID;
|
|
@@ -18,8 +19,6 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
18
19
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
19
20
|
classList: ClassBase[];
|
|
20
21
|
completionStatus: CompletionStatusType;
|
|
21
|
-
createTransferEntryStatus: FetchState;
|
|
22
|
-
creditCardAccountsForTransferList: AccountBase[];
|
|
23
22
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
24
23
|
isAccountingProjectsEnabled: boolean;
|
|
25
24
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
@@ -27,11 +26,11 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
27
26
|
refreshStatus: FetchStateAndError;
|
|
28
27
|
saveStatus: FetchStateAndError;
|
|
29
28
|
selectedCheckBoxTransactionIds: ID[];
|
|
29
|
+
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
30
30
|
totalCountByTab: Record<TransactionsTab, number>;
|
|
31
31
|
transactionIdsWithUnsavedData: ID[];
|
|
32
32
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
33
33
|
transactions: SupportedTransactionWithCOT[];
|
|
34
|
-
transferAccounts: AccountBase[];
|
|
35
34
|
uiState: TransactionsViewUIState;
|
|
36
35
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
37
36
|
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { RootState } from '../../../reducer';
|
|
2
2
|
import { ExpenseAutomationTransactionViewSelector } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
3
|
-
import { TransferEntryRouteReplacement } from '../types/transactionsViewState';
|
|
4
|
-
export declare function getLastTransferEntryReplacement(state: RootState): TransferEntryRouteReplacement | undefined;
|
|
5
3
|
export declare function getExpenseAutomationTransactionView(state: RootState): ExpenseAutomationTransactionViewSelector;
|
|
@@ -3,12 +3,10 @@ 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.getLastTransferEntryReplacement = getLastTransferEntryReplacement;
|
|
7
6
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
8
7
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
10
9
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
|
-
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
12
10
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
11
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
14
12
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
@@ -16,12 +14,9 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
|
16
14
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
17
15
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
18
16
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
19
|
-
function getLastTransferEntryReplacement(state) {
|
|
20
|
-
return state.expenseAutomationTransactionsViewState.lastTransferEntryReplacement;
|
|
21
|
-
}
|
|
22
17
|
function getExpenseAutomationTransactionView(state) {
|
|
23
18
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
24
|
-
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
19
|
+
const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
25
20
|
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
26
21
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
27
22
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
@@ -97,29 +92,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
97
92
|
: [];
|
|
98
93
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
99
94
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
100
|
-
const transferAccountsFromApi = expenseAutomationTransactionsViewState.transferAccounts.accountIds
|
|
101
|
-
.map((id) => (0, accountSelector_1.getAccountBaseForTransferAccounts)(accountState, id))
|
|
102
|
-
.filter((account) => account != null);
|
|
103
|
-
/**
|
|
104
|
-
* Credit transfer picker uses transfer-account ids from a dedicated fetch. If that list
|
|
105
|
-
* resolves to nothing while the COA list is loaded, fall back to the full COA list so the
|
|
106
|
-
* credit dropdown is not empty.
|
|
107
|
-
*/
|
|
108
|
-
const transferAccountsList = transferAccountsFromApi.length > 0
|
|
109
|
-
? transferAccountsFromApi
|
|
110
|
-
: accountList.accounts
|
|
111
|
-
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
112
|
-
.filter((account) => account != null);
|
|
113
|
-
const creditCardAccountsFromApi = expenseAutomationTransactionsViewState.creditCardAccountsForTransfer.accountIds
|
|
114
|
-
.map((id) => (0, accountSelector_1.getAccountBaseForCreditCardTransferAccounts)(accountState, id))
|
|
115
|
-
.filter((account) => account != null);
|
|
116
|
-
const coaCreditCardsFallback = accountList.accounts
|
|
117
|
-
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
118
|
-
.filter((account) => account != null)
|
|
119
|
-
.filter((a) => a.accountType === 'credit_card');
|
|
120
|
-
const creditCardAccountsForTransferList = creditCardAccountsFromApi.length > 0
|
|
121
|
-
? creditCardAccountsFromApi
|
|
122
|
-
: coaCreditCardsFallback;
|
|
123
95
|
return {
|
|
124
96
|
version: 0,
|
|
125
97
|
fetchState: fetchStatus.fetchState,
|
|
@@ -140,14 +112,12 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
140
112
|
refreshStatus,
|
|
141
113
|
saveStatus,
|
|
142
114
|
markAsNotMiscategorizedStatus,
|
|
143
|
-
createTransferEntryStatus: expenseAutomationTransactionsViewState.createTransferEntryStatus,
|
|
144
115
|
completionStatus,
|
|
145
116
|
totalCountByTab,
|
|
146
117
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
147
118
|
uploadReceiptStatusById,
|
|
148
119
|
selectedTransactionId,
|
|
149
120
|
selectedTransactionLineId,
|
|
150
|
-
|
|
151
|
-
transferAccounts: transferAccountsList,
|
|
121
|
+
selectedTransactionCategorizationCompletedSubTab,
|
|
152
122
|
};
|
|
153
123
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCompletedSubTab = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
/**
|
|
6
|
+
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
7
|
+
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
8
|
+
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
9
|
+
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
10
|
+
*/
|
|
11
|
+
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
12
|
+
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
13
|
+
exports.toCompletedSubTab = toCompletedSubTab;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
|
+
import { CompletedSubTab } from './completedSubTab';
|
|
4
5
|
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
5
6
|
export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
|
|
6
7
|
export interface MissingReceiptsViewUIState {
|
|
@@ -31,8 +32,6 @@ export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmat
|
|
|
31
32
|
export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
|
|
32
33
|
export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
|
|
33
34
|
export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
|
|
34
|
-
export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
|
|
35
|
-
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
36
35
|
export declare const toMatchSource: (v: string) => "manual" | "ai";
|
|
37
36
|
export type MatchSource = ReturnType<typeof toMatchSource>;
|
|
38
37
|
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBulkUploadSortKey = exports.toMatchSource = exports.
|
|
3
|
+
exports.toBulkUploadSortKey = exports.toMatchSource = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
|
|
4
4
|
exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
|
|
5
5
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
6
6
|
const MISSING_RECEIPTS_SORT_KEYS = [
|
|
@@ -49,9 +49,6 @@ exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
|
|
|
49
49
|
const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
|
|
50
50
|
const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
|
|
51
51
|
exports.toMissingReceiptsTab = toMissingReceiptsTab;
|
|
52
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
53
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
54
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|
|
55
52
|
const MATCH_SOURCES = ['ai', 'manual'];
|
|
56
53
|
const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
|
|
57
54
|
exports.toMatchSource = toMatchSource;
|
|
@@ -13,9 +13,11 @@ import { TransactionID } from '../../../entity/transaction/stateTypes/transactio
|
|
|
13
13
|
import { BillableStatus, CategorizationStatusType, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../../entity/transaction/stateTypes/transactionLine';
|
|
14
14
|
import { TransactionCategory, TransactionType } from '../../../entity/transaction/stateTypes/transactionType';
|
|
15
15
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
16
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
16
17
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
17
18
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
18
19
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
|
+
import { CompletedSubTab } from './completedSubTab';
|
|
19
21
|
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
20
22
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
21
23
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
@@ -103,26 +105,33 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
103
105
|
selectedTransactionId?: ID;
|
|
104
106
|
selectedTransactionLineId?: ID;
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Snapshot of the autoCategorized tab's paginated dataset for a single
|
|
110
|
+
* Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
|
|
111
|
+
* so revisiting an already-loaded sub-tab can short-circuit the fetch epic
|
|
112
|
+
* (mirrors parent-tab caching). The snapshot is period-spanning — both the
|
|
113
|
+
* `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
|
|
114
|
+
* period the user has paged through under that sub-tab.
|
|
115
|
+
*/
|
|
116
|
+
export interface AutoCategorizedSubTabSnapshot {
|
|
117
|
+
error: ZeniAPIStatus | undefined;
|
|
108
118
|
fetchState: FetchState;
|
|
119
|
+
pageToken: PageToken;
|
|
120
|
+
totalCount: Record<MonthYearPeriodId, number>;
|
|
121
|
+
transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
|
|
109
122
|
}
|
|
110
|
-
/** Which pool `fetchAccountsForTransferFlow` / transfer-flow epic should load. */
|
|
111
|
-
export declare const TRANSFER_ACCOUNTS_FETCH_KIND: readonly ["transfer_eligible", "credit_card_only"];
|
|
112
|
-
export type TransferAccountsFetchKind = (typeof TRANSFER_ACCOUNTS_FETCH_KIND)[number];
|
|
113
|
-
export type TransferEntryRouteReplacement = {
|
|
114
|
-
newTransactionId: TransactionID;
|
|
115
|
-
previousTransactionId: TransactionID;
|
|
116
|
-
};
|
|
117
123
|
export type TransactionsViewState = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
|
|
126
|
+
* by {@link CompletedSubTab}. Populated as the user navigates between
|
|
127
|
+
* sub-tabs and consulted on every switch — the active autoCategorized slot
|
|
128
|
+
* is restored from here when a snapshot exists, otherwise it is reset and
|
|
129
|
+
* the fetch epic loads page 1 fresh.
|
|
130
|
+
*/
|
|
131
|
+
autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
|
|
132
|
+
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
123
133
|
selectedTransactionCategorizationTab: TransactionsTab;
|
|
124
134
|
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
125
|
-
transferAccounts: TransferAccountsState;
|
|
126
135
|
};
|
|
127
136
|
export interface TransactionLineUpdates {
|
|
128
137
|
account?: AccountBase;
|