From d73353b4b47a66d9b057c4f590564620d3b06047 Mon Sep 17 00:00:00 2001 From: Andrii Vitiv Date: Sat, 11 Jan 2025 18:43:43 +0200 Subject: [PATCH] Revert removal of the `receipt` param In `CategorizeTrackedExpense` and `ShareTrackedExpense` commands --- src/libs/API/parameters/CategorizeTrackedExpenseParams.ts | 3 +++ src/libs/API/parameters/ShareTrackedExpenseParams.ts | 3 +++ src/libs/actions/IOU.ts | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/src/libs/API/parameters/CategorizeTrackedExpenseParams.ts b/src/libs/API/parameters/CategorizeTrackedExpenseParams.ts index d6d8f4169d76..78eb0adecc5e 100644 --- a/src/libs/API/parameters/CategorizeTrackedExpenseParams.ts +++ b/src/libs/API/parameters/CategorizeTrackedExpenseParams.ts @@ -1,3 +1,5 @@ +import type {Receipt} from '@src/types/onyx/Transaction'; + type CategorizeTrackedExpenseParams = { amount: number; currency: string; @@ -14,6 +16,7 @@ type CategorizeTrackedExpenseParams = { reportPreviewReportActionID: string; category?: string; tag?: string; + receipt?: Receipt; taxCode: string; taxAmount: number; billable?: boolean; diff --git a/src/libs/API/parameters/ShareTrackedExpenseParams.ts b/src/libs/API/parameters/ShareTrackedExpenseParams.ts index dc95d211427b..cee4bc40d9ac 100644 --- a/src/libs/API/parameters/ShareTrackedExpenseParams.ts +++ b/src/libs/API/parameters/ShareTrackedExpenseParams.ts @@ -1,3 +1,5 @@ +import type {Receipt} from '@src/types/onyx/Transaction'; + type ShareTrackedExpenseParams = { amount: number; currency: string; @@ -14,6 +16,7 @@ type ShareTrackedExpenseParams = { reportPreviewReportActionID: string; category?: string; tag?: string; + receipt?: Receipt; taxCode: string; taxAmount: number; billable?: boolean; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 7f35f781d8d7..684d3fb23e5e 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -126,6 +126,7 @@ type CategorizeTrackedExpenseTransactionParams = { category?: string; tag?: string; billable?: boolean; + receipt?: Receipt; }; type CategorizeTrackedExpensePolicyParams = { policyID: string; @@ -3851,6 +3852,7 @@ function shareTrackedExpense( taxCode = '', taxAmount = 0, billable?: boolean, + receipt?: Receipt, createdWorkspaceParams?: CreateWorkspaceParams, ) { const {optimisticData, successData, failureData} = onyxData ?? {}; @@ -3893,6 +3895,7 @@ function shareTrackedExpense( taxCode, taxAmount, billable, + receipt: receipt instanceof Blob ? receipt : undefined, policyExpenseChatReportID: createdWorkspaceParams?.expenseChatReportID, policyExpenseCreatedReportActionID: createdWorkspaceParams?.expenseCreatedReportActionID, adminsChatReportID: createdWorkspaceParams?.adminsChatReportID, @@ -4195,6 +4198,7 @@ function trackExpense( category, tag, billable, + receipt: trackedReceipt instanceof Blob ? trackedReceipt : undefined, }; const policyParams: CategorizeTrackedExpensePolicyParams = { policyID: chatReport?.policyID ?? '-1', @@ -4247,6 +4251,7 @@ function trackExpense( taxCode, taxAmount, billable, + trackedReceipt, createdWorkspaceParams, ); break;