@zeniai/client-epic-state 4.19.37-betaVR9 → 4.19.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +1 -9
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +1 -9
- package/lib/esm/index.js +2 -4
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -100
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -264
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -128
- package/lib/esm/zeniAPI.js +3 -41
- package/lib/index.d.ts +5 -7
- package/lib/index.js +30 -58
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -108
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -107
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -51
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -265
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -61
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -127
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -104
- package/lib/zeniAPI.d.ts +0 -9
- package/lib/zeniAPI.js +2 -40
- package/package.json +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -24
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -31
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -41
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -57
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -35
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -27
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -41
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -15
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -28
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -35
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -45
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -39
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -31
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -15
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -46
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
20
20
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
21
21
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
22
22
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
23
|
-
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" | "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" | "
|
|
23
|
+
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" | "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" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "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";
|
|
24
24
|
messageText: "notification" | "success" | "failed";
|
|
25
25
|
type: "error" | "success" | "info";
|
|
26
26
|
variables: {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { URLPayload } from '../../../commonPayloadTypes/urlPayload';
|
|
2
1
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
3
|
-
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
4
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
-
import type { BatchDetails, BatchFile, BatchListItem, BatchStatus, BatchSummary, ManualSearchResult } from '../types/missingReceiptsViewState';
|
|
6
3
|
export interface MissingReceiptsQueryPayload {
|
|
7
4
|
end_date: string;
|
|
8
5
|
is_attachment_missing_only: boolean;
|
|
@@ -16,109 +13,4 @@ interface MissingReceiptsPayload {
|
|
|
16
13
|
transactions: TransactionPayload[];
|
|
17
14
|
}
|
|
18
15
|
export type MissingReceiptsResponse = ZeniAPIResponse<MissingReceiptsPayload>;
|
|
19
|
-
export interface BulkUploadResponsePayload {
|
|
20
|
-
batch_id: string;
|
|
21
|
-
status: string;
|
|
22
|
-
total_files: number;
|
|
23
|
-
}
|
|
24
|
-
export type BulkUploadResponse = ZeniAPIResponse<BulkUploadResponsePayload>;
|
|
25
|
-
export interface BatchStatusResponsePayload {
|
|
26
|
-
batch_id: string;
|
|
27
|
-
progress: {
|
|
28
|
-
processed: number;
|
|
29
|
-
total: number;
|
|
30
|
-
};
|
|
31
|
-
status: string;
|
|
32
|
-
}
|
|
33
|
-
export type BatchStatusResponse = ZeniAPIResponse<BatchStatusResponsePayload>;
|
|
34
|
-
export interface BatchListResponsePayload {
|
|
35
|
-
batches: BatchListItemPayload[];
|
|
36
|
-
}
|
|
37
|
-
export interface BatchListItemPayload {
|
|
38
|
-
batch_id: string;
|
|
39
|
-
created_at: string;
|
|
40
|
-
failed_count: number;
|
|
41
|
-
matched_count: number;
|
|
42
|
-
no_match_count: number;
|
|
43
|
-
possible_matches_count: number;
|
|
44
|
-
status: string;
|
|
45
|
-
total_files: number;
|
|
46
|
-
}
|
|
47
|
-
export type BatchListResponse = ZeniAPIResponse<BatchListResponsePayload>;
|
|
48
|
-
export interface MatchedTransactionPayload {
|
|
49
|
-
amount: number;
|
|
50
|
-
currency_code: string;
|
|
51
|
-
transaction_date: string | null;
|
|
52
|
-
transaction_id: string;
|
|
53
|
-
vendor_name: string;
|
|
54
|
-
transaction_type?: string;
|
|
55
|
-
vendor_logo?: URLPayload | null;
|
|
56
|
-
}
|
|
57
|
-
export interface MatchCandidatePayload extends MatchedTransactionPayload {
|
|
58
|
-
match_score: number;
|
|
59
|
-
}
|
|
60
|
-
export interface BatchFilePayload {
|
|
61
|
-
attachment_id: string;
|
|
62
|
-
file_id: string;
|
|
63
|
-
file_preview_url: string | null;
|
|
64
|
-
filename: string;
|
|
65
|
-
status: string;
|
|
66
|
-
candidates?: MatchCandidatePayload[];
|
|
67
|
-
match_source?: string;
|
|
68
|
-
matched_transaction?: MatchedTransactionPayload;
|
|
69
|
-
}
|
|
70
|
-
export interface BatchDetailsResponsePayload {
|
|
71
|
-
batch_id: string;
|
|
72
|
-
created_at: string;
|
|
73
|
-
files: BatchFilePayload[];
|
|
74
|
-
status: string;
|
|
75
|
-
summary: {
|
|
76
|
-
failed: number;
|
|
77
|
-
matched: number;
|
|
78
|
-
no_match: number;
|
|
79
|
-
possible_matches: number;
|
|
80
|
-
total: number;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
export type BatchDetailsResponse = ZeniAPIResponse<BatchDetailsResponsePayload>;
|
|
84
|
-
export declare function toBatchFile(payload: BatchFilePayload): BatchFile;
|
|
85
|
-
export declare function extractTransactionPayloadsFromBatchFiles(files: BatchFilePayload[]): SupportedTransactionPayload[];
|
|
86
|
-
export declare function toBatchSummary(payload: BatchDetailsResponsePayload['summary']): BatchSummary;
|
|
87
|
-
export declare function toBatchStatus(payload: BatchStatusResponsePayload): BatchStatus;
|
|
88
|
-
export declare function toBatchDetails(payload: BatchDetailsResponsePayload): BatchDetails;
|
|
89
|
-
export declare function toBatchListItem(payload: BatchListItemPayload): BatchListItem;
|
|
90
|
-
export interface TransactionSearchQueryPayload {
|
|
91
|
-
search_text: string;
|
|
92
|
-
search_fields?: string[];
|
|
93
|
-
}
|
|
94
|
-
export interface TransactionSearchItemPayload {
|
|
95
|
-
amount: number;
|
|
96
|
-
currency: string;
|
|
97
|
-
entity_id: string;
|
|
98
|
-
memo: string;
|
|
99
|
-
transaction_date: string;
|
|
100
|
-
transaction_id: string;
|
|
101
|
-
transaction_type: string;
|
|
102
|
-
vendor_name: string;
|
|
103
|
-
}
|
|
104
|
-
export interface TransactionSearchResponsePayload {
|
|
105
|
-
transactions: TransactionSearchItemPayload[];
|
|
106
|
-
}
|
|
107
|
-
export type TransactionSearchResponse = ZeniAPIResponse<TransactionSearchResponsePayload>;
|
|
108
|
-
export declare function toManualSearchResult(payload: TransactionSearchItemPayload): ManualSearchResult;
|
|
109
|
-
export interface CompletedTransactionsQueryPayload {
|
|
110
|
-
end_date?: string;
|
|
111
|
-
match_type?: string;
|
|
112
|
-
page_size?: number;
|
|
113
|
-
page_token?: string | null;
|
|
114
|
-
sort_by?: string;
|
|
115
|
-
sort_order?: string;
|
|
116
|
-
start_date?: string;
|
|
117
|
-
}
|
|
118
|
-
export interface CompletedTransactionsResponsePayload {
|
|
119
|
-
next_page_token: string | null;
|
|
120
|
-
total_count: number;
|
|
121
|
-
transactions: SupportedTransactionPayload[];
|
|
122
|
-
}
|
|
123
|
-
export type CompletedTransactionsResponse = ZeniAPIResponse<CompletedTransactionsResponsePayload>;
|
|
124
16
|
export {};
|
|
@@ -1,109 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBatchFile = toBatchFile;
|
|
4
|
-
exports.extractTransactionPayloadsFromBatchFiles = extractTransactionPayloadsFromBatchFiles;
|
|
5
|
-
exports.toBatchSummary = toBatchSummary;
|
|
6
|
-
exports.toBatchStatus = toBatchStatus;
|
|
7
|
-
exports.toBatchDetails = toBatchDetails;
|
|
8
|
-
exports.toBatchListItem = toBatchListItem;
|
|
9
|
-
exports.toManualSearchResult = toManualSearchResult;
|
|
10
|
-
const urlPayload_1 = require("../../../commonPayloadTypes/urlPayload");
|
|
11
|
-
// -- Converter functions --
|
|
12
|
-
function toBatchFile(payload) {
|
|
13
|
-
return {
|
|
14
|
-
attachmentId: payload.attachment_id,
|
|
15
|
-
candidates: payload.candidates?.map((c) => ({
|
|
16
|
-
transactionId: c.transaction_id,
|
|
17
|
-
matchScore: c.match_score,
|
|
18
|
-
})),
|
|
19
|
-
fileId: payload.file_id,
|
|
20
|
-
filePreviewUrl: payload.file_preview_url,
|
|
21
|
-
filename: payload.filename,
|
|
22
|
-
matchSource: payload.match_source,
|
|
23
|
-
matchedTransactionId: payload.matched_transaction?.transaction_id,
|
|
24
|
-
status: payload.status,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function extractTransactionPayloadsFromBatchFiles(files) {
|
|
28
|
-
const seen = new Set();
|
|
29
|
-
const payloads = [];
|
|
30
|
-
for (const file of files) {
|
|
31
|
-
if (file.matched_transaction != null) {
|
|
32
|
-
const id = file.matched_transaction.transaction_id;
|
|
33
|
-
if (!seen.has(id)) {
|
|
34
|
-
seen.add(id);
|
|
35
|
-
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(file.matched_transaction));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (file.candidates != null) {
|
|
39
|
-
for (const candidate of file.candidates) {
|
|
40
|
-
const id = candidate.transaction_id;
|
|
41
|
-
if (!seen.has(id)) {
|
|
42
|
-
seen.add(id);
|
|
43
|
-
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(candidate));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return payloads;
|
|
49
|
-
}
|
|
50
|
-
function matchedTransactionPayloadToSupportedTransactionPayload(payload) {
|
|
51
|
-
return {
|
|
52
|
-
transaction_id: payload.transaction_id,
|
|
53
|
-
transaction_type: payload.transaction_type ?? 'expense',
|
|
54
|
-
transaction_date: payload.transaction_date ?? '',
|
|
55
|
-
currency_code: payload.currency_code,
|
|
56
|
-
total_amount: payload.amount,
|
|
57
|
-
vendor_name: payload.vendor_name,
|
|
58
|
-
logo: payload.vendor_logo == null ? undefined : (0, urlPayload_1.toURL)(payload.vendor_logo),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function toBatchSummary(payload) {
|
|
62
|
-
return {
|
|
63
|
-
failed: payload.failed,
|
|
64
|
-
matched: payload.matched,
|
|
65
|
-
noMatch: payload.no_match,
|
|
66
|
-
possibleMatches: payload.possible_matches,
|
|
67
|
-
total: payload.total,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
function toBatchStatus(payload) {
|
|
71
|
-
return {
|
|
72
|
-
batchId: payload.batch_id,
|
|
73
|
-
progress: payload.progress,
|
|
74
|
-
status: payload.status,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function toBatchDetails(payload) {
|
|
78
|
-
return {
|
|
79
|
-
batchId: payload.batch_id,
|
|
80
|
-
createdAt: payload.created_at,
|
|
81
|
-
files: payload.files.map(toBatchFile),
|
|
82
|
-
status: payload.status,
|
|
83
|
-
summary: toBatchSummary(payload.summary),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function toBatchListItem(payload) {
|
|
87
|
-
return {
|
|
88
|
-
batchId: payload.batch_id,
|
|
89
|
-
createdAt: payload.created_at,
|
|
90
|
-
failedCount: payload.failed_count,
|
|
91
|
-
matchedCount: payload.matched_count,
|
|
92
|
-
noMatchCount: payload.no_match_count,
|
|
93
|
-
possibleMatchesCount: payload.possible_matches_count,
|
|
94
|
-
status: payload.status,
|
|
95
|
-
totalFiles: payload.total_files,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function toManualSearchResult(payload) {
|
|
99
|
-
return {
|
|
100
|
-
amount: payload.amount,
|
|
101
|
-
currencyCode: payload.currency,
|
|
102
|
-
entityId: payload.entity_id,
|
|
103
|
-
memo: payload.memo,
|
|
104
|
-
transactionDate: payload.transaction_date,
|
|
105
|
-
transactionId: payload.transaction_id,
|
|
106
|
-
transactionType: payload.transaction_type,
|
|
107
|
-
vendorName: payload.vendor_name,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError,
|
|
3
|
-
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
2
|
+
import { FetchStateAndError, UpdateType } from '../../../commonStateTypes/common';
|
|
4
3
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
5
4
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
6
5
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
7
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
8
|
-
import
|
|
9
|
-
export declare const initialBulkUploadState: BulkUploadState;
|
|
7
|
+
import { MissingReceiptsViewState, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
10
8
|
export declare const initialState: MissingReceiptsViewState;
|
|
11
9
|
export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, minimumTransactionAmount: Amount, cacheOverride?: any, refreshViewInBackground?: any], {
|
|
12
10
|
period: TimePeriod;
|
|
@@ -28,52 +26,6 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
|
|
|
28
26
|
}, "expenseAutomationMissingReceiptsView/updateMissingReceiptUploadState", never, never>, updateMissingReceiptsUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<MissingReceiptsViewUIState>, "expenseAutomationMissingReceiptsView/updateMissingReceiptsUIState">, markMissingReceiptAsDone: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionPayload: SupportedTransactionPayload, selectedPeriod: MonthYearPeriod], {
|
|
29
27
|
transactionPayload: SupportedTransactionPayload;
|
|
30
28
|
selectedPeriod: MonthYearPeriod;
|
|
31
|
-
}, "expenseAutomationMissingReceiptsView/markMissingReceiptAsDone", never, never>, clearExpenseAutomationMissingReceiptsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearExpenseAutomationMissingReceiptsView"
|
|
32
|
-
files: File[];
|
|
33
|
-
}, "expenseAutomationMissingReceiptsView/bulkUploadReceipts", never, never>, updateBulkUploadProgress: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "expenseAutomationMissingReceiptsView/updateBulkUploadProgress">, bulkUploadReceiptsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
|
-
batchId: ID;
|
|
35
|
-
}, "expenseAutomationMissingReceiptsView/bulkUploadReceiptsSuccess">, bulkUploadReceiptsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
36
|
-
error: ZeniAPIStatus;
|
|
37
|
-
}, "expenseAutomationMissingReceiptsView/bulkUploadReceiptsFailure">, updateBulkUploadBatchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchStatus, "expenseAutomationMissingReceiptsView/updateBulkUploadBatchStatus">, pusherBatchStatusUpdate: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchStatus, "expenseAutomationMissingReceiptsView/pusherBatchStatusUpdate">, fetchBulkUploadBatchDetails: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetails">, fetchBulkUploadBatchDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchDetails, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetailsSuccess">, fetchBulkUploadBatchDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
|
-
error: ZeniAPIStatus;
|
|
39
|
-
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetailsFailure">, storeBatchDetails: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchDetails, "expenseAutomationMissingReceiptsView/storeBatchDetails">, fetchBulkUploadBatches: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
40
|
-
cacheOverride: any;
|
|
41
|
-
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatches", never, never>, fetchBulkUploadBatchesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
42
|
-
batchList: BatchListItem[];
|
|
43
|
-
selectedPeriod: MonthYearPeriod;
|
|
44
|
-
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesSuccess">, fetchBulkUploadBatchesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
45
|
-
error: ZeniAPIStatus;
|
|
46
|
-
selectedPeriod: MonthYearPeriod;
|
|
47
|
-
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesFailure">, confirmBulkUploadMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[batchId: string, attachmentId: string, transactionId: string, transactionType: string, fileName: string], {
|
|
48
|
-
batchId: string;
|
|
49
|
-
attachmentId: string;
|
|
50
|
-
transactionId: string;
|
|
51
|
-
transactionType: string;
|
|
52
|
-
fileName: string;
|
|
53
|
-
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatch", never, never>, confirmBulkUploadMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
|
-
attachmentId: ID;
|
|
55
|
-
batchId: ID;
|
|
56
|
-
transactionId: ID;
|
|
57
|
-
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchSuccess">, confirmBulkUploadMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
|
-
error: ZeniAPIStatus;
|
|
59
|
-
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<BulkUploadResultsTab, "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<CompletedSubTab, "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
60
|
-
sortKey: BulkUploadSortKey;
|
|
61
|
-
sortOrder: SortOrder;
|
|
62
|
-
}, "expenseAutomationMissingReceiptsView/setBulkUploadSortConfig">, clearBulkUpload: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUpload">, searchTransactionsForManualMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string], {
|
|
63
|
-
query: string;
|
|
64
|
-
}, "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatch", never, never>, searchTransactionsForManualMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<ManualSearchResult[], "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatchSuccess">, searchTransactionsForManualMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
|
-
error: ZeniAPIStatus;
|
|
66
|
-
}, "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatchFailure">, clearManualSearchResults: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearManualSearchResults">, fetchCompletedTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[pageToken?: string | undefined], {
|
|
67
|
-
pageToken: string | undefined;
|
|
68
|
-
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactions", never, never>, fetchCompletedTransactionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
69
|
-
isInitialLoad: boolean;
|
|
70
|
-
nextPageToken: string | null;
|
|
71
|
-
selectedPeriod: MonthYearPeriod;
|
|
72
|
-
totalCount: number;
|
|
73
|
-
transactionIds: ID[];
|
|
74
|
-
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactionsSuccess">, fetchCompletedTransactionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
75
|
-
error: ZeniAPIStatus;
|
|
76
|
-
selectedPeriod: MonthYearPeriod;
|
|
77
|
-
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactionsFailure">;
|
|
29
|
+
}, "expenseAutomationMissingReceiptsView/markMissingReceiptAsDone", never, never>, clearExpenseAutomationMissingReceiptsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearExpenseAutomationMissingReceiptsView">;
|
|
78
30
|
declare const _default: import("redux").Reducer<MissingReceiptsViewState>;
|
|
79
31
|
export default _default;
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
|
-
exports.initialBulkUploadState = {
|
|
8
|
-
batchDetailsById: {},
|
|
9
|
-
batchListByPeriod: {},
|
|
10
|
-
batchListFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
11
|
-
batchStatusById: {},
|
|
12
|
-
completedSubTab: 'all',
|
|
13
|
-
completedTransactionsByPeriod: {},
|
|
14
|
-
confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
15
|
-
currentBatchId: undefined,
|
|
16
|
-
currentResultsTab: 'unmatched',
|
|
17
|
-
manualSearch: {
|
|
18
|
-
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
19
|
-
results: [],
|
|
20
|
-
searchQuery: '',
|
|
21
|
-
},
|
|
22
|
-
phase: 'idle',
|
|
23
|
-
sortKey: 'date',
|
|
24
|
-
sortOrder: 'descending',
|
|
25
|
-
uploadProgress: 0,
|
|
26
|
-
uploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
27
|
-
};
|
|
28
7
|
exports.initialState = {
|
|
29
|
-
bulkUpload: exports.initialBulkUploadState,
|
|
30
8
|
uploadReceiptStatusById: {},
|
|
31
9
|
refreshStatus: {
|
|
32
10
|
fetchState: 'Not-Started',
|
|
@@ -146,248 +124,7 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
|
|
|
146
124
|
clearExpenseAutomationMissingReceiptsView(draft) {
|
|
147
125
|
Object.assign(draft, exports.initialState);
|
|
148
126
|
},
|
|
149
|
-
// -- Bulk Upload Actions --
|
|
150
|
-
bulkUploadReceipts: {
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
152
|
-
reducer(draft, _action) {
|
|
153
|
-
draft.bulkUpload.phase = 'uploading';
|
|
154
|
-
draft.bulkUpload.uploadProgress = 0;
|
|
155
|
-
draft.bulkUpload.uploadStatus = {
|
|
156
|
-
fetchState: 'In-Progress',
|
|
157
|
-
error: undefined,
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
prepare(files) {
|
|
161
|
-
return { payload: { files } };
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
updateBulkUploadProgress(draft, action) {
|
|
165
|
-
draft.bulkUpload.uploadProgress = action.payload;
|
|
166
|
-
},
|
|
167
|
-
bulkUploadReceiptsSuccess(draft, action) {
|
|
168
|
-
draft.bulkUpload.currentBatchId = action.payload.batchId;
|
|
169
|
-
draft.bulkUpload.uploadStatus = {
|
|
170
|
-
fetchState: 'Completed',
|
|
171
|
-
error: undefined,
|
|
172
|
-
};
|
|
173
|
-
draft.bulkUpload.phase = 'matching';
|
|
174
|
-
},
|
|
175
|
-
bulkUploadReceiptsFailure(draft, action) {
|
|
176
|
-
draft.bulkUpload.uploadStatus = {
|
|
177
|
-
fetchState: 'Error',
|
|
178
|
-
error: action.payload.error,
|
|
179
|
-
};
|
|
180
|
-
draft.bulkUpload.phase = 'idle';
|
|
181
|
-
},
|
|
182
|
-
updateBulkUploadBatchStatus(draft, action) {
|
|
183
|
-
const batchStatus = action.payload;
|
|
184
|
-
draft.bulkUpload.batchStatusById[batchStatus.batchId] = batchStatus;
|
|
185
|
-
},
|
|
186
|
-
pusherBatchStatusUpdate(draft, action) {
|
|
187
|
-
const batchStatus = action.payload;
|
|
188
|
-
draft.bulkUpload.batchStatusById[batchStatus.batchId] = batchStatus;
|
|
189
|
-
},
|
|
190
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
191
|
-
fetchBulkUploadBatchDetails(_draft) {
|
|
192
|
-
// trigger epic, no state change needed
|
|
193
|
-
},
|
|
194
|
-
fetchBulkUploadBatchDetailsSuccess(draft, action) {
|
|
195
|
-
const details = action.payload;
|
|
196
|
-
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
197
|
-
draft.bulkUpload.phase = 'completed';
|
|
198
|
-
},
|
|
199
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
200
|
-
fetchBulkUploadBatchDetailsFailure(draft, _action) {
|
|
201
|
-
draft.bulkUpload.phase = 'completed';
|
|
202
|
-
},
|
|
203
|
-
storeBatchDetails(draft, action) {
|
|
204
|
-
const details = action.payload;
|
|
205
|
-
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
206
|
-
},
|
|
207
|
-
fetchBulkUploadBatches: {
|
|
208
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
209
|
-
reducer(draft, _action) {
|
|
210
|
-
draft.bulkUpload.batchListFetchState = {
|
|
211
|
-
fetchState: 'In-Progress',
|
|
212
|
-
error: undefined,
|
|
213
|
-
};
|
|
214
|
-
},
|
|
215
|
-
prepare(cacheOverride = false) {
|
|
216
|
-
return { payload: { cacheOverride } };
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
fetchBulkUploadBatchesSuccess(draft, action) {
|
|
220
|
-
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
|
|
221
|
-
draft.bulkUpload.batchListByPeriod[periodId] = action.payload.batchList;
|
|
222
|
-
draft.bulkUpload.batchListFetchState = {
|
|
223
|
-
fetchState: 'Completed',
|
|
224
|
-
error: undefined,
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
fetchBulkUploadBatchesFailure(draft, action) {
|
|
228
|
-
draft.bulkUpload.batchListFetchState = {
|
|
229
|
-
fetchState: 'Error',
|
|
230
|
-
error: action.payload.error,
|
|
231
|
-
};
|
|
232
|
-
},
|
|
233
|
-
confirmBulkUploadMatch: {
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
235
|
-
reducer(draft, _action) {
|
|
236
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
237
|
-
fetchState: 'In-Progress',
|
|
238
|
-
error: undefined,
|
|
239
|
-
};
|
|
240
|
-
},
|
|
241
|
-
prepare(batchId, attachmentId, transactionId, transactionType, fileName) {
|
|
242
|
-
return { payload: { batchId, attachmentId, transactionId, transactionType, fileName } };
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
confirmBulkUploadMatchSuccess(draft, action) {
|
|
246
|
-
const { batchId, attachmentId, transactionId } = action.payload;
|
|
247
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
248
|
-
fetchState: 'Completed',
|
|
249
|
-
error: undefined,
|
|
250
|
-
};
|
|
251
|
-
const details = draft.bulkUpload.batchDetailsById[batchId];
|
|
252
|
-
if (details != null) {
|
|
253
|
-
const file = details.files.find((f) => f.attachmentId === attachmentId);
|
|
254
|
-
if (file != null) {
|
|
255
|
-
const originalStatus = file.status;
|
|
256
|
-
file.status = 'matched';
|
|
257
|
-
file.matchedTransactionId = transactionId;
|
|
258
|
-
file.candidates = undefined;
|
|
259
|
-
details.summary.matched += 1;
|
|
260
|
-
if (originalStatus === 'no_match') {
|
|
261
|
-
details.summary.noMatch = Math.max(0, details.summary.noMatch - 1);
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
details.summary.possibleMatches = Math.max(0, details.summary.possibleMatches - 1);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
confirmBulkUploadMatchFailure(draft, action) {
|
|
270
|
-
draft.bulkUpload.confirmMatchStatus = {
|
|
271
|
-
fetchState: 'Error',
|
|
272
|
-
error: action.payload.error,
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
setBulkUploadResultsTab(draft, action) {
|
|
276
|
-
draft.bulkUpload.currentResultsTab = action.payload;
|
|
277
|
-
},
|
|
278
|
-
setBulkUploadCompletedSubTab(draft, action) {
|
|
279
|
-
draft.bulkUpload.completedSubTab = action.payload;
|
|
280
|
-
draft.bulkUpload.completedTransactionsByPeriod = {};
|
|
281
|
-
},
|
|
282
|
-
setBulkUploadSortConfig(draft, action) {
|
|
283
|
-
draft.bulkUpload.sortKey = action.payload.sortKey;
|
|
284
|
-
draft.bulkUpload.sortOrder = action.payload.sortOrder;
|
|
285
|
-
},
|
|
286
|
-
clearBulkUpload(draft) {
|
|
287
|
-
Object.assign(draft.bulkUpload, exports.initialBulkUploadState);
|
|
288
|
-
},
|
|
289
|
-
searchTransactionsForManualMatch: {
|
|
290
|
-
reducer(draft, action) {
|
|
291
|
-
draft.bulkUpload.manualSearch.searchQuery = action.payload.query;
|
|
292
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
293
|
-
fetchState: 'In-Progress',
|
|
294
|
-
error: undefined,
|
|
295
|
-
};
|
|
296
|
-
draft.bulkUpload.manualSearch.results = [];
|
|
297
|
-
},
|
|
298
|
-
prepare(query) {
|
|
299
|
-
return { payload: { query } };
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
searchTransactionsForManualMatchSuccess(draft, action) {
|
|
303
|
-
draft.bulkUpload.manualSearch.results = action.payload;
|
|
304
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
305
|
-
fetchState: 'Completed',
|
|
306
|
-
error: undefined,
|
|
307
|
-
};
|
|
308
|
-
},
|
|
309
|
-
searchTransactionsForManualMatchFailure(draft, action) {
|
|
310
|
-
draft.bulkUpload.manualSearch.fetchState = {
|
|
311
|
-
fetchState: 'Error',
|
|
312
|
-
error: action.payload.error,
|
|
313
|
-
};
|
|
314
|
-
},
|
|
315
|
-
clearManualSearchResults(draft) {
|
|
316
|
-
draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
|
|
317
|
-
},
|
|
318
|
-
// -- Completed Transactions Actions --
|
|
319
|
-
fetchCompletedTransactions: {
|
|
320
|
-
reducer(draft, action) {
|
|
321
|
-
const { pageToken } = action.payload;
|
|
322
|
-
if (pageToken != null) {
|
|
323
|
-
const periods = draft.bulkUpload.completedTransactionsByPeriod;
|
|
324
|
-
for (const entry of Object.values(periods)) {
|
|
325
|
-
if (entry.nextPageToken === pageToken) {
|
|
326
|
-
entry.fetchState = {
|
|
327
|
-
fetchState: 'In-Progress',
|
|
328
|
-
error: undefined,
|
|
329
|
-
};
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
prepare(pageToken) {
|
|
336
|
-
return { payload: { pageToken } };
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
fetchCompletedTransactionsSuccess(draft, action) {
|
|
340
|
-
const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad } = action.payload;
|
|
341
|
-
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
|
|
342
|
-
if (isInitialLoad) {
|
|
343
|
-
draft.bulkUpload.completedTransactionsByPeriod[periodId] = {
|
|
344
|
-
transactionIds,
|
|
345
|
-
nextPageToken,
|
|
346
|
-
totalCount,
|
|
347
|
-
fetchState: { fetchState: 'Completed', error: undefined },
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
const existing = draft.bulkUpload.completedTransactionsByPeriod[periodId];
|
|
352
|
-
if (existing != null) {
|
|
353
|
-
existing.transactionIds.push(...transactionIds);
|
|
354
|
-
existing.nextPageToken = nextPageToken;
|
|
355
|
-
existing.totalCount = totalCount;
|
|
356
|
-
existing.fetchState = { fetchState: 'Completed', error: undefined };
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
draft.bulkUpload.completedTransactionsByPeriod[periodId] = {
|
|
360
|
-
transactionIds,
|
|
361
|
-
nextPageToken,
|
|
362
|
-
totalCount,
|
|
363
|
-
fetchState: { fetchState: 'Completed', error: undefined },
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
fetchCompletedTransactionsFailure(draft, action) {
|
|
369
|
-
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
|
|
370
|
-
const existing = draft.bulkUpload.completedTransactionsByPeriod[periodId];
|
|
371
|
-
if (existing != null) {
|
|
372
|
-
existing.fetchState = {
|
|
373
|
-
fetchState: 'Error',
|
|
374
|
-
error: action.payload.error,
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
draft.bulkUpload.completedTransactionsByPeriod[periodId] = {
|
|
379
|
-
fetchState: { fetchState: 'Error', error: action.payload.error },
|
|
380
|
-
nextPageToken: null,
|
|
381
|
-
totalCount: 0,
|
|
382
|
-
transactionIds: [],
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
127
|
},
|
|
387
128
|
});
|
|
388
|
-
_a = expenseAutomationMissingReceiptsView.actions, exports.fetchMissingReceipts = _a.fetchMissingReceipts, exports.fetchMissingReceiptsSuccess = _a.fetchMissingReceiptsSuccess, exports.fetchMissingReceiptsFailure = _a.fetchMissingReceiptsFailure, exports.uploadMissingReceiptSuccess = _a.uploadMissingReceiptSuccess, exports.updateMissingReceiptUploadState = _a.updateMissingReceiptUploadState, exports.updateMissingReceiptsUIState = _a.updateMissingReceiptsUIState, exports.markMissingReceiptAsDone = _a.markMissingReceiptAsDone, exports.clearExpenseAutomationMissingReceiptsView = _a.clearExpenseAutomationMissingReceiptsView
|
|
389
|
-
// Bulk Upload
|
|
390
|
-
exports.bulkUploadReceipts = _a.bulkUploadReceipts, exports.updateBulkUploadProgress = _a.updateBulkUploadProgress, exports.bulkUploadReceiptsSuccess = _a.bulkUploadReceiptsSuccess, exports.bulkUploadReceiptsFailure = _a.bulkUploadReceiptsFailure, exports.updateBulkUploadBatchStatus = _a.updateBulkUploadBatchStatus, exports.pusherBatchStatusUpdate = _a.pusherBatchStatusUpdate, exports.fetchBulkUploadBatchDetails = _a.fetchBulkUploadBatchDetails, exports.fetchBulkUploadBatchDetailsSuccess = _a.fetchBulkUploadBatchDetailsSuccess, exports.fetchBulkUploadBatchDetailsFailure = _a.fetchBulkUploadBatchDetailsFailure, exports.storeBatchDetails = _a.storeBatchDetails, exports.fetchBulkUploadBatches = _a.fetchBulkUploadBatches, exports.fetchBulkUploadBatchesSuccess = _a.fetchBulkUploadBatchesSuccess, exports.fetchBulkUploadBatchesFailure = _a.fetchBulkUploadBatchesFailure, exports.confirmBulkUploadMatch = _a.confirmBulkUploadMatch, exports.confirmBulkUploadMatchSuccess = _a.confirmBulkUploadMatchSuccess, exports.confirmBulkUploadMatchFailure = _a.confirmBulkUploadMatchFailure, exports.setBulkUploadResultsTab = _a.setBulkUploadResultsTab, exports.setBulkUploadCompletedSubTab = _a.setBulkUploadCompletedSubTab, exports.setBulkUploadSortConfig = _a.setBulkUploadSortConfig, exports.clearBulkUpload = _a.clearBulkUpload, exports.searchTransactionsForManualMatch = _a.searchTransactionsForManualMatch, exports.searchTransactionsForManualMatchSuccess = _a.searchTransactionsForManualMatchSuccess, exports.searchTransactionsForManualMatchFailure = _a.searchTransactionsForManualMatchFailure, exports.clearManualSearchResults = _a.clearManualSearchResults,
|
|
391
|
-
// Completed Transactions
|
|
392
|
-
exports.fetchCompletedTransactions = _a.fetchCompletedTransactions, exports.fetchCompletedTransactionsSuccess = _a.fetchCompletedTransactionsSuccess, exports.fetchCompletedTransactionsFailure = _a.fetchCompletedTransactionsFailure;
|
|
129
|
+
_a = expenseAutomationMissingReceiptsView.actions, exports.fetchMissingReceipts = _a.fetchMissingReceipts, exports.fetchMissingReceiptsSuccess = _a.fetchMissingReceiptsSuccess, exports.fetchMissingReceiptsFailure = _a.fetchMissingReceiptsFailure, exports.uploadMissingReceiptSuccess = _a.uploadMissingReceiptSuccess, exports.updateMissingReceiptUploadState = _a.updateMissingReceiptUploadState, exports.updateMissingReceiptsUIState = _a.updateMissingReceiptsUIState, exports.markMissingReceiptAsDone = _a.markMissingReceiptAsDone, exports.clearExpenseAutomationMissingReceiptsView = _a.clearExpenseAutomationMissingReceiptsView;
|
|
393
130
|
exports.default = expenseAutomationMissingReceiptsView.reducer;
|