@zeniai/client-epic-state 5.0.61-betaML1 → 5.0.61-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 +9 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -8
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +79 -78
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -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.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +8 -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 +15 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +10 -23
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +80 -79
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +15 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -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 +32 -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,6 +26,9 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
|
|
|
26
26
|
page_token: pageToken,
|
|
27
27
|
page_size: 25,
|
|
28
28
|
search_text: uiState.searchString,
|
|
29
|
+
sub_tab: selectedTab === 'autoCategorized'
|
|
30
|
+
? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
|
|
31
|
+
: 'all',
|
|
29
32
|
};
|
|
30
33
|
return zeniAPI
|
|
31
34
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -48,6 +51,11 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
|
|
|
48
51
|
selectedTab,
|
|
49
52
|
totalCount: response.data.total_count,
|
|
50
53
|
}));
|
|
54
|
+
updateActions.push((0, transactionsViewReducer_1.updateParentTotalCountForTab)({
|
|
55
|
+
selectedPeriod,
|
|
56
|
+
selectedTab,
|
|
57
|
+
parentTotalCount: response.data.parent_tab_total_count,
|
|
58
|
+
}));
|
|
51
59
|
updateActions.push((0, transactionsViewReducer_1.resetOtherTabsFetchState)({
|
|
52
60
|
refreshViewInBackground,
|
|
53
61
|
tabs: transactionsViewState_1.TRANSACTIONS_TABS.filter((tab) => selectedTab !== tab),
|
|
@@ -5,6 +5,6 @@ import { fetchAccountList } from '../../../accountList/accountListReducer';
|
|
|
5
5
|
import { fetchClassList } from '../../../classList/classListReducer';
|
|
6
6
|
import { fetchOwnerList } from '../../../ownerList/ownerListReducer';
|
|
7
7
|
import { fetchProjectList } from '../../../projectList/projectListReducer';
|
|
8
|
-
import { fetchTransactionCategorization, fetchTransactionCategorizationView
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchTransactionCategorizationView> | ReturnType<typeof fetchTransactionCategorization> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchOwnerList> | ReturnType<typeof
|
|
8
|
+
import { fetchTransactionCategorization, fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchTransactionCategorizationView> | ReturnType<typeof fetchTransactionCategorization> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchOwnerList> | ReturnType<typeof fetchProjectList>;
|
|
10
10
|
export declare const fetchTransactionCategorizationViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -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,9 +12,23 @@ 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;
|
|
25
|
+
/**
|
|
26
|
+
* Count of transactions for the entire parent tab (Review or Completed),
|
|
27
|
+
* regardless of which sub-tab the listing was scoped to. Used solely to
|
|
28
|
+
* drive the parent tab badge counts on the UI; pagination, list-level
|
|
29
|
+
* counts, and sub-tab chips continue to consume {@link total_count}.
|
|
30
|
+
*/
|
|
31
|
+
parent_tab_total_count: number;
|
|
17
32
|
query: TransactionCategorizationQueryPayload;
|
|
18
33
|
total_count: number;
|
|
19
34
|
transactions: SupportedTransactionPayload[];
|
|
@@ -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;
|
|
@@ -120,7 +122,11 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
120
122
|
selectedPeriod: MonthYearPeriod;
|
|
121
123
|
selectedTab: TransactionsTab;
|
|
122
124
|
totalCount: number;
|
|
123
|
-
}, "expenseAutomationTransactionsView/updateTotalCountForTransactionCategorization">,
|
|
125
|
+
}, "expenseAutomationTransactionsView/updateTotalCountForTransactionCategorization">, updateParentTotalCountForTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
126
|
+
parentTotalCount: number;
|
|
127
|
+
selectedPeriod: MonthYearPeriod;
|
|
128
|
+
selectedTab: TransactionsTab;
|
|
129
|
+
}, "expenseAutomationTransactionsView/updateParentTotalCountForTab">, fetchTransactionCategorizationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
124
130
|
selectedTab: TransactionsTab;
|
|
125
131
|
status: ZeniAPIStatus;
|
|
126
132
|
refreshViewInBackground?: boolean;
|
|
@@ -164,26 +170,7 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
164
170
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
165
171
|
period: TimePeriod;
|
|
166
172
|
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], {
|
|
173
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
187
174
|
selectedTab: "review" | "autoCategorized";
|
|
188
175
|
transactionId: string;
|
|
189
176
|
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.updateParentTotalCountForTab = 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,44 @@ exports.initialTransactionTabViewState = {
|
|
|
49
48
|
selectedTransactionLineId: undefined,
|
|
50
49
|
};
|
|
51
50
|
exports.initialState = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
autoCategorizedSubTabCache: {},
|
|
52
|
+
parentTotalCountByTab: {
|
|
53
|
+
review: {},
|
|
54
|
+
autoCategorized: {},
|
|
56
55
|
},
|
|
57
|
-
lastTransferEntryReplacement: undefined,
|
|
58
56
|
selectedTransactionCategorizationTab: 'review',
|
|
57
|
+
selectedTransactionCategorizationCompletedSubTab: 'all',
|
|
59
58
|
transactionCategorizationView: {
|
|
60
59
|
review: { ...exports.initialTransactionTabViewState },
|
|
61
60
|
autoCategorized: { ...exports.initialTransactionTabViewState },
|
|
62
61
|
},
|
|
63
|
-
transferAccounts: {
|
|
64
|
-
accountIds: [],
|
|
65
|
-
fetchState: 'Not-Started',
|
|
66
|
-
},
|
|
67
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Capture the autoCategorized tab's current paginated dataset for a sub-tab.
|
|
65
|
+
* The mid-flight `'In-Progress'` state is normalised to `'Completed'` because
|
|
66
|
+
* the in-flight request is cancelled by `switchMap` in the fetch epic when the
|
|
67
|
+
* sub-tab changes — restoring `'In-Progress'` later would leave the UI stuck
|
|
68
|
+
* showing a phantom loading state with no fetch actually running. Length-zero
|
|
69
|
+
* datasets degrade to `'Not-Started'` so the next visit triggers a fresh
|
|
70
|
+
* fetch from page 1 instead of short-circuiting on stale empty caches.
|
|
71
|
+
*/
|
|
72
|
+
function snapshotAutoCategorizedTab(autoCat) {
|
|
73
|
+
const transactionIdsBySelectedPeriod = {
|
|
74
|
+
...autoCat.transactionIdsBySelectedPeriod,
|
|
75
|
+
};
|
|
76
|
+
const hasAnyLoadedRows = Object.values(transactionIdsBySelectedPeriod).some((ids) => ids.length > 0);
|
|
77
|
+
let normalisedFetchState = autoCat.fetchState;
|
|
78
|
+
if (normalisedFetchState === 'In-Progress') {
|
|
79
|
+
normalisedFetchState = hasAnyLoadedRows ? 'Completed' : 'Not-Started';
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
error: autoCat.error,
|
|
83
|
+
fetchState: normalisedFetchState,
|
|
84
|
+
pageToken: autoCat.uiState.pageToken,
|
|
85
|
+
totalCount: { ...autoCat.uiState.totalCount },
|
|
86
|
+
transactionIdsBySelectedPeriod,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
68
89
|
const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
69
90
|
name: 'expenseAutomationTransactionsView',
|
|
70
91
|
initialState: exports.initialState,
|
|
@@ -278,6 +299,48 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
278
299
|
return { payload: { newSelectedTab } };
|
|
279
300
|
},
|
|
280
301
|
},
|
|
302
|
+
updateTransactionCategorizationCompletedSubTab: {
|
|
303
|
+
reducer(draft, action) {
|
|
304
|
+
const { newSubTab } = action.payload;
|
|
305
|
+
const previousSubTab = draft.selectedTransactionCategorizationCompletedSubTab;
|
|
306
|
+
if (previousSubTab === newSubTab) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const autoCat = draft.transactionCategorizationView.autoCategorized;
|
|
310
|
+
// Snapshot the outgoing sub-tab so a future revisit can short-circuit
|
|
311
|
+
// the fetch epic (mirrors the parent-tab "don't refetch what's
|
|
312
|
+
// already cached" behaviour). Period-scoped data is preserved as-is
|
|
313
|
+
// because the snapshot itself is keyed only by sub-tab; the active
|
|
314
|
+
// tab's per-period maps remain the source of truth while live.
|
|
315
|
+
draft.autoCategorizedSubTabCache[previousSubTab] =
|
|
316
|
+
snapshotAutoCategorizedTab(autoCat);
|
|
317
|
+
const cached = draft.autoCategorizedSubTabCache[newSubTab];
|
|
318
|
+
if (cached != null) {
|
|
319
|
+
autoCat.uiState.pageToken = cached.pageToken;
|
|
320
|
+
autoCat.uiState.totalCount = { ...cached.totalCount };
|
|
321
|
+
autoCat.transactionIdsBySelectedPeriod = {
|
|
322
|
+
...cached.transactionIdsBySelectedPeriod,
|
|
323
|
+
};
|
|
324
|
+
autoCat.fetchState = cached.fetchState;
|
|
325
|
+
autoCat.error = cached.error;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
// Sub-tab has never been visited — clear the active slot so the
|
|
329
|
+
// view-epic's `fetchState === 'Not-Started' || transactionIds.length
|
|
330
|
+
// === 0` cache check falls through and triggers a fresh page-1
|
|
331
|
+
// fetch for the new dataset.
|
|
332
|
+
autoCat.uiState.pageToken = null;
|
|
333
|
+
autoCat.uiState.totalCount = {};
|
|
334
|
+
autoCat.transactionIdsBySelectedPeriod = {};
|
|
335
|
+
autoCat.fetchState = 'Not-Started';
|
|
336
|
+
autoCat.error = undefined;
|
|
337
|
+
}
|
|
338
|
+
draft.selectedTransactionCategorizationCompletedSubTab = newSubTab;
|
|
339
|
+
},
|
|
340
|
+
prepare(newSubTab) {
|
|
341
|
+
return { payload: { newSubTab } };
|
|
342
|
+
},
|
|
343
|
+
},
|
|
281
344
|
updateTransactionCategorization: {
|
|
282
345
|
reducer(draft, action) {
|
|
283
346
|
const selectedTab = action.payload.selectedTab;
|
|
@@ -715,6 +778,10 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
715
778
|
const { selectedTab, selectedPeriod, totalCount } = action.payload;
|
|
716
779
|
draft.transactionCategorizationView[selectedTab].uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = totalCount;
|
|
717
780
|
},
|
|
781
|
+
updateParentTotalCountForTab(draft, action) {
|
|
782
|
+
const { selectedTab, selectedPeriod, parentTotalCount } = action.payload;
|
|
783
|
+
draft.parentTotalCountByTab[selectedTab][(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = parentTotalCount;
|
|
784
|
+
},
|
|
718
785
|
updateSelectedCheckboxTransactionIds(draft, action) {
|
|
719
786
|
const selectedTab = action.payload.selectedTab;
|
|
720
787
|
const transactionIds = action.payload.transactionIds;
|
|
@@ -725,6 +792,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
725
792
|
draft.transactionCategorizationView[selectedTab] = {
|
|
726
793
|
...exports.initialTransactionTabViewState,
|
|
727
794
|
};
|
|
795
|
+
draft.parentTotalCountByTab[selectedTab] = {};
|
|
728
796
|
},
|
|
729
797
|
clearExpenseAutomationTransactionsView(draft) {
|
|
730
798
|
Object.assign(draft, exports.initialState);
|
|
@@ -819,74 +887,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
819
887
|
};
|
|
820
888
|
},
|
|
821
889
|
},
|
|
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
890
|
},
|
|
890
891
|
});
|
|
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.
|
|
892
|
+
_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.updateParentTotalCountForTab = _a.updateParentTotalCountForTab, 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
893
|
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,20 +19,30 @@ 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;
|
|
25
|
+
/**
|
|
26
|
+
* Parent tab badge counts, sourced from the listing response's
|
|
27
|
+
* `parent_tab_total_count`. Used exclusively to drive the navbar / tab
|
|
28
|
+
* strip badge labels — every other count consumer (pagination, in-list
|
|
29
|
+
* "showing X of Y", save flows) keeps reading {@link totalCountByTab}.
|
|
30
|
+
*/
|
|
31
|
+
parentTabTotalCountByTab: Record<TransactionsTab, number>;
|
|
26
32
|
projectList: ProjectListSelectorView;
|
|
27
33
|
refreshStatus: FetchStateAndError;
|
|
28
34
|
saveStatus: FetchStateAndError;
|
|
29
35
|
selectedCheckBoxTransactionIds: ID[];
|
|
36
|
+
selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
|
|
37
|
+
/**
|
|
38
|
+
* Per-(sub-)tab counts mirroring `total_count` from the listing response.
|
|
39
|
+
* Powers pagination via `InfiniteLoader.itemCount`, in-list count copy,
|
|
40
|
+
* and the `resetTransactionCategorizationLocalData` round-trip.
|
|
41
|
+
*/
|
|
30
42
|
totalCountByTab: Record<TransactionsTab, number>;
|
|
31
43
|
transactionIdsWithUnsavedData: ID[];
|
|
32
44
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
33
45
|
transactions: SupportedTransactionWithCOT[];
|
|
34
|
-
transferAccounts: AccountBase[];
|
|
35
46
|
uiState: TransactionsViewUIState;
|
|
36
47
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
37
48
|
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');
|
|
@@ -74,10 +69,27 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
74
69
|
.uiState.totalCount;
|
|
75
70
|
const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
76
71
|
.autoCategorized.uiState.totalCount;
|
|
72
|
+
// Per-(sub-)tab counts powering pagination, in-list "showing X of Y", and
|
|
73
|
+
// any save/refresh round-trips. Sourced from `uiState.totalCount` which
|
|
74
|
+
// mirrors the response's `total_count` for whatever tab/sub-tab the user is
|
|
75
|
+
// viewing (e.g. only the Manual sub-tab rows for Completed → Manual).
|
|
77
76
|
const totalCountByTab = {
|
|
78
77
|
review: monthYearPeriodId != null ? totalCountByReview[monthYearPeriodId] : 0,
|
|
79
78
|
autoCategorized: monthYearPeriodId != null ? totalCountByAutoCat[monthYearPeriodId] : 0,
|
|
80
79
|
};
|
|
80
|
+
// Parent-tab badge counts. Sourced from `parent_tab_total_count` in the
|
|
81
|
+
// listing response and used exclusively by the navbar / tab strip badges.
|
|
82
|
+
// Independent of which Completed sub-tab is active so the badge stays
|
|
83
|
+
// stable across sub-tab switches.
|
|
84
|
+
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
85
|
+
const parentTabTotalCountByTab = {
|
|
86
|
+
review: monthYearPeriodId != null
|
|
87
|
+
? (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
88
|
+
: 0,
|
|
89
|
+
autoCategorized: monthYearPeriodId != null
|
|
90
|
+
? (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
91
|
+
: 0,
|
|
92
|
+
};
|
|
81
93
|
const fetchStateByTab = {
|
|
82
94
|
review: {
|
|
83
95
|
fetchState: expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
@@ -97,29 +109,6 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
97
109
|
: [];
|
|
98
110
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
99
111
|
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
112
|
return {
|
|
124
113
|
version: 0,
|
|
125
114
|
fetchState: fetchStatus.fetchState,
|
|
@@ -140,14 +129,13 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
140
129
|
refreshStatus,
|
|
141
130
|
saveStatus,
|
|
142
131
|
markAsNotMiscategorizedStatus,
|
|
143
|
-
createTransferEntryStatus: expenseAutomationTransactionsViewState.createTransferEntryStatus,
|
|
144
132
|
completionStatus,
|
|
145
133
|
totalCountByTab,
|
|
134
|
+
parentTabTotalCountByTab,
|
|
146
135
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
147
136
|
uploadReceiptStatusById,
|
|
148
137
|
selectedTransactionId,
|
|
149
138
|
selectedTransactionLineId,
|
|
150
|
-
|
|
151
|
-
transferAccounts: transferAccountsList,
|
|
139
|
+
selectedTransactionCategorizationCompletedSubTab,
|
|
152
140
|
};
|
|
153
141
|
}
|
|
@@ -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;
|