From fed09e4d9b1564942d2b4f88924fb336f519c6a0 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 5 Jul 2026 07:44:05 +0530 Subject: [PATCH 1/4] Thread delegateAccountID through split and inline edit flows Signed-off-by: krishna2323 --- src/hooks/useDeleteTransactions.ts | 4 ++ src/hooks/useTransactionInlineEdit.ts | 3 ++ src/libs/actions/IOU/Split.ts | 22 ++++----- .../actions/IOU/SplitTransactionUpdate.ts | 10 ++-- src/libs/actions/TransactionInlineEdit.ts | 5 +- src/pages/iou/DynamicSplitBillDetailsPage.tsx | 17 ++++++- src/pages/iou/SplitExpensePage.tsx | 3 ++ .../components/ScanSkipConfirmation.tsx | 3 ++ .../step/confirmation/useExpenseSubmission.ts | 5 ++ tests/actions/IOU/SplitReportTotalsTest.ts | 2 + tests/actions/IOUTest/SplitSelfDMTest.ts | 6 +++ tests/actions/IOUTest/SplitTest.ts | 46 ++++++++++++++++++- tests/actions/TransactionTest.ts | 4 ++ 13 files changed, 109 insertions(+), 21 deletions(-) diff --git a/src/hooks/useDeleteTransactions.ts b/src/hooks/useDeleteTransactions.ts index 5fcb93de0ef9..9b775dac408b 100644 --- a/src/hooks/useDeleteTransactions.ts +++ b/src/hooks/useDeleteTransactions.ts @@ -29,6 +29,7 @@ import passthroughPolicyTagListSelector from '@selectors/PolicyTagList'; import {useCallback} from 'react'; import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails'; +import useDelegateAccountID from './useDelegateAccountID'; import useEnvironment from './useEnvironment'; import useNetwork from './useNetwork'; import useOnyx from './useOnyx'; @@ -80,6 +81,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac const [allReportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS); const [allSnapshots] = useOnyx(ONYXKEYS.COLLECTION.SNAPSHOT); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); + const delegateAccountID = useDelegateAccountID(); const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const [policyRecentlyUsedCurrencies] = useOnyx(ONYXKEYS.RECENTLY_USED_CURRENCIES); const [quickAction] = useOnyx(ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE); @@ -320,6 +322,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac transactionReport: report, expenseReport, isOffline, + delegateAccountID, }); } @@ -392,6 +395,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac isOffline, isProduction, personalPolicy?.outputCurrency, + delegateAccountID, ], ); diff --git a/src/hooks/useTransactionInlineEdit.ts b/src/hooks/useTransactionInlineEdit.ts index 6369c63fd50e..70ab65b9a8ec 100644 --- a/src/hooks/useTransactionInlineEdit.ts +++ b/src/hooks/useTransactionInlineEdit.ts @@ -32,6 +32,7 @@ import {useCallback, useRef} from 'react'; // eslint-disable-next-line no-restricted-imports -- Need original useOnyx to avoid reading partial Search snapshot policy data. import {useOnyx as originalUseOnyx} from 'react-native-onyx'; +import useDelegateAccountID from './useDelegateAccountID'; import useDistanceRateOriginalPolicy from './useDistanceRateOriginalPolicy'; import useNetwork from './useNetwork'; import useOnyx from './useOnyx'; @@ -79,6 +80,7 @@ type UseTransactionInlineEditReturn = { }; function useTransactionInlineEdit({transactionID, hash, linkedReportAction}: UseTransactionInlineEditParams): UseTransactionInlineEditReturn { + const delegateAccountID = useDelegateAccountID(); const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`); const reportID = transaction?.reportID; @@ -182,6 +184,7 @@ function useTransactionInlineEdit({transactionID, hash, linkedReportAction}: Use isSelfTourViewed: guidedSetupAndTourStatus?.isSelfTourViewed ?? false, hasCompletedGuidedSetupFlow: guidedSetupAndTourStatus?.hasCompletedGuidedSetupFlow ?? false, distanceOriginalPolicy, + delegateAccountID, }; }; diff --git a/src/libs/actions/IOU/Split.ts b/src/libs/actions/IOU/Split.ts index 6114823272b8..dd1d97da7ccc 100644 --- a/src/libs/actions/IOU/Split.ts +++ b/src/libs/actions/IOU/Split.ts @@ -170,8 +170,7 @@ type CreateSplitsAndOnyxDataParams = { betas: OnyxEntry; personalDetails: OnyxEntry; participantsPolicyTags: Record; - // TODO: delegateAccountID will be made required in PR 11 when all callers pass the value (https://github.com/Expensify/App/issues/66425) - delegateAccountID?: number | undefined; + delegateAccountID: number | undefined; }; type StartSplitBilActionParams = { @@ -197,6 +196,7 @@ type StartSplitBilActionParams = { quickAction: OnyxEntry; policyRecentlyUsedCurrencies: string[]; participantsPolicyTags: Record; + delegateAccountID: number | undefined; }; type SplitBillActionsParams = { @@ -229,8 +229,7 @@ type SplitBillActionsParams = { personalDetails: OnyxEntry; shouldHandleNavigation?: boolean; shouldDeferForSearch?: boolean; - // TODO: delegateAccountID will be made required in PR 11 when all callers pass the value (https://github.com/Expensify/App/issues/66425) - delegateAccountID?: number | undefined; + delegateAccountID: number | undefined; }; /** @@ -485,6 +484,7 @@ function startSplitBill({ participantsPolicyTags, shouldHandleNavigation = true, shouldDeferForSearch = false, + delegateAccountID, }: StartSplitBilActionParams) { const currentUserEmailForIOUSplit = addSMSDomainIfPhoneNumber(currentUserLogin); const participantAccountIDs = participants.map((participant) => Number(participant.accountID)); @@ -526,8 +526,7 @@ function startSplitBill({ transactionID: splitTransaction.transactionID, isOwnPolicyExpenseChat, iouReportID: splitChatReport.reportID, - // delegateAccountIDParam: will be threaded in PR 11; buildOptimisticIOUReportAction falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - delegateAccountIDParam: undefined, + delegateAccountIDParam: delegateAccountID, }); splitChatReport.lastReadTime = DateUtils.getDBTime(); @@ -676,6 +675,7 @@ function startSplitBill({ policyRecentlyUsedCurrencies, policyRecentlyUsedTags, participantsPolicyTags, + delegateAccountID, }; if (existingSplitChatReport) { @@ -873,6 +873,7 @@ function completeSplitBill( transactionViolations: OnyxCollection, betas: OnyxEntry, personalDetails: OnyxEntry, + delegateAccountID: number | undefined, sessionEmail?: string, ) { if (!reportAction) { @@ -1077,16 +1078,14 @@ function completeSplitBill( participants: [participant], transactionID: oneOnOneTransaction.transactionID, currentUserAccountID: sessionAccountID, - // delegateAccountIDParam: will be threaded in PR 11; buildOptimisticIOUReportAction falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - delegateAccountIDParam: undefined, + delegateAccountIDParam: delegateAccountID, }); let oneOnOneReportPreviewAction = getReportPreviewAction(oneOnOneChatReport?.reportID, oneOnOneIOUReport?.reportID); if (oneOnOneReportPreviewAction) { oneOnOneReportPreviewAction = updateReportPreview(oneOnOneIOUReport, oneOnOneReportPreviewAction); } else { - // delegateAccountID: will be threaded in PR 11; buildOptimisticReportPreview falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - oneOnOneReportPreviewAction = buildOptimisticReportPreview(oneOnOneChatReport, oneOnOneIOUReport, '', oneOnOneTransaction, undefined, undefined, undefined); + oneOnOneReportPreviewAction = buildOptimisticReportPreview(oneOnOneChatReport, oneOnOneIOUReport, '', oneOnOneTransaction, undefined, undefined, delegateAccountID); } const hasViolations = hasViolationsReportUtils(oneOnOneIOUReport.reportID, transactionViolations, sessionAccountID, sessionEmail ?? ''); @@ -1122,8 +1121,7 @@ function completeSplitBill( }, quickAction, personalDetails, - // delegateAccountID: will be threaded in PR 11; buildOptimisticIOUReportAction falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - delegateAccountID: undefined, + delegateAccountID, }); splits.push({ diff --git a/src/libs/actions/IOU/SplitTransactionUpdate.ts b/src/libs/actions/IOU/SplitTransactionUpdate.ts index 7b6da20796d6..62a3c86a3c23 100644 --- a/src/libs/actions/IOU/SplitTransactionUpdate.ts +++ b/src/libs/actions/IOU/SplitTransactionUpdate.ts @@ -107,6 +107,7 @@ type UpdateSplitTransactionsParams = { transactionReport: OnyxEntry; expenseReport: OnyxEntry; isOffline: boolean; + delegateAccountID: number | undefined; }; function updateSplitTransactions({ @@ -135,6 +136,7 @@ function updateSplitTransactions({ transactionReport, expenseReport: expenseReportFromParams, isOffline, + delegateAccountID, }: UpdateSplitTransactionsParams) { const parentTransactionReport = getReportOrDraftReport(transactionReport?.parentReportID); // For selfDM-origin splits the caller can't resolve a real `expenseReport` (the draft/source @@ -590,6 +592,7 @@ function updateSplitTransactions({ policyRecentlyUsedCurrencies, betas, personalDetails, + delegateAccountID, } as MoneyRequestInformationParams; if (isReverseSplitOperation) { @@ -702,6 +705,7 @@ function updateSplitTransactions({ policyRecentlyUsedCurrencies, betas, personalDetails, + delegateAccountID, }); let updateMoneyRequestParamsOnyxData: OnyxData = {}; @@ -796,8 +800,7 @@ function updateSplitTransactions({ isSplitTransaction: true, isSelfDMSplit, isOffline, - // delegateAccountID: will be threaded in PR 11; buildOptimisticModifiedExpenseReportAction falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - delegateAccountID: undefined, + delegateAccountID, }); if (currentSplit) { currentSplit.modifiedExpenseReportActionID = params.reportActionID; @@ -872,13 +875,12 @@ function updateSplitTransactions({ const failureDataComments: Array> = []; const addCommentToSplitTransactionThread = (commentAction: OnyxTypes.ReportAction) => { const newReportActionID = rand64(); - // delegateAccountIDParam: will be threaded in PR 11; buildOptimisticAddCommentReportAction falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) const reportComment = buildOptimisticAddCommentReportAction({ text: '', actorAccountID: commentAction.actorAccountID, reportID: transactionThreadReportID, reportActionID: newReportActionID, - delegateAccountIDParam: undefined, + delegateAccountIDParam: delegateAccountID, }); const reportActionComment = { ...reportComment.reportAction, diff --git a/src/libs/actions/TransactionInlineEdit.ts b/src/libs/actions/TransactionInlineEdit.ts index 6d0761bd14be..a82ae439073a 100644 --- a/src/libs/actions/TransactionInlineEdit.ts +++ b/src/libs/actions/TransactionInlineEdit.ts @@ -190,6 +190,7 @@ type GetIouParamsInput = { isSelfTourViewed: boolean | undefined; hasCompletedGuidedSetupFlow: boolean | undefined; distanceOriginalPolicy?: OnyxEntry; + delegateAccountID: number | undefined; }; type TransactionInlineEditParams = GetIouParamsInput & { @@ -218,6 +219,7 @@ function getIouParamsForTransaction({ parentReportNextStep, isSelfTourViewed, hasCompletedGuidedSetupFlow, + delegateAccountID, }: GetIouParamsInput) { const transaction = allTransactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]; const transactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`]; @@ -279,8 +281,7 @@ function getIouParamsForTransaction({ currentUserAccountIDParam: currentUserAccountID, currentUserEmailParam: currentUserEmail, isASAPSubmitBetaEnabled: Permissions.isBetaEnabled(CONST.BETAS.ASAP_SUBMIT, allBetas), - // delegateAccountID: will be threaded in PR 11; updateMoneyRequest* falls back to module-level Onyx.connect value (https://github.com/Expensify/App/issues/66425) - delegateAccountID: undefined, + delegateAccountID, // Field-specific extras transaction, policyTagList: policyTags, diff --git a/src/pages/iou/DynamicSplitBillDetailsPage.tsx b/src/pages/iou/DynamicSplitBillDetailsPage.tsx index 4465f27fa3b6..7c820f8355d0 100644 --- a/src/pages/iou/DynamicSplitBillDetailsPage.tsx +++ b/src/pages/iou/DynamicSplitBillDetailsPage.tsx @@ -6,6 +6,7 @@ import MoneyRequestConfirmationList from '@components/MoneyRequestConfirmationLi import MoneyRequestHeaderStatusBar from '@components/MoneyRequestHeaderStatusBar'; import ScreenWrapper from '@components/ScreenWrapper'; +import useDelegateAccountID from '@hooks/useDelegateAccountID'; import useDynamicBackPath from '@hooks/useDynamicBackPath'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; @@ -90,6 +91,7 @@ function DynamicSplitBillDetailsPage({report, reportAction}: SplitBillDetailsPag const [isConfirmed, setIsConfirmed] = useState(false); const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT); + const delegateAccountID = useDelegateAccountID(); const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const onConfirm = useCallback(() => { setIsConfirmed(true); @@ -103,9 +105,22 @@ function DynamicSplitBillDetailsPage({report, reportAction}: SplitBillDetailsPag transactionViolations, betas, personalDetails, + delegateAccountID, session?.email, ); - }, [reportID, reportAction, draftTransaction, session?.accountID, session?.email, isASAPSubmitBetaEnabled, quickAction, transactionViolations, betas, personalDetails]); + }, [ + reportID, + reportAction, + draftTransaction, + session?.accountID, + session?.email, + isASAPSubmitBetaEnabled, + quickAction, + transactionViolations, + betas, + personalDetails, + delegateAccountID, + ]); return ( diff --git a/src/pages/iou/SplitExpensePage.tsx b/src/pages/iou/SplitExpensePage.tsx index 27118ed6ee2e..61e19bf2ed01 100644 --- a/src/pages/iou/SplitExpensePage.tsx +++ b/src/pages/iou/SplitExpensePage.tsx @@ -15,6 +15,7 @@ import useAllTransactions from '@hooks/useAllTransactions'; import useConfirmModal from '@hooks/useConfirmModal'; import {useCurrencyListActions} from '@hooks/useCurrencyList'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; +import useDelegateAccountID from '@hooks/useDelegateAccountID'; import useEnvironment from '@hooks/useEnvironment'; import useGetIOUReportFromReportAction from '@hooks/useGetIOUReportFromReportAction'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; @@ -95,6 +96,7 @@ const TAB_NAVIGATOR_HEIGHT_LANDSCAPE = variables.tabSelectorButtonHeight + varia function SplitExpensePage({route}: SplitExpensePageProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); + const delegateAccountID = useDelegateAccountID(); const {reportID, transactionID, splitExpenseTransactionID, backTo} = route.params; @@ -381,6 +383,7 @@ function SplitExpensePage({route}: SplitExpensePageProps) { transactionReport: draftTransactionReport, expenseReport, isOffline, + delegateAccountID, }); }; diff --git a/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx index becc825f8ae9..00280a28ef26 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx @@ -2,6 +2,7 @@ import {useFullScreenLoaderActions} from '@components/FullScreenLoaderContext'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import useDelegateAccountID from '@hooks/useDelegateAccountID'; import useFilesValidation from '@hooks/useFilesValidation'; import useOnyx from '@hooks/useOnyx'; import useOptimisticDraftTransactions from '@hooks/useOptimisticDraftTransactions'; @@ -75,6 +76,7 @@ function ScanSkipConfirmation({report, action, iouType, reportID, transactionID, const selfDMReport = useSelfDMReport(); const reportAttributesDerived = useReportAttributes(); const {isBetaEnabled} = usePermissions(); + const delegateAccountID = useDelegateAccountID(); const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); @@ -204,6 +206,7 @@ function ScanSkipConfirmation({report, action, iouType, reportID, transactionID, policyRecentlyUsedCurrencies: policyRecentlyUsedCurrencies ?? [], policyRecentlyUsedTags: undefined, participantsPolicyTags, + delegateAccountID, }; submitWithDismissFirst({ diff --git a/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts b/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts index 181266b3a21e..dddf021ccbda 100644 --- a/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts +++ b/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts @@ -1,4 +1,5 @@ import useActivePolicy from '@hooks/useActivePolicy'; +import useDelegateAccountID from '@hooks/useDelegateAccountID'; import useLastWorkspaceNumber from '@hooks/useLastWorkspaceNumber'; import useLocalize from '@hooks/useLocalize'; import useOnboardingTaskInformation from '@hooks/useOnboardingTaskInformation'; @@ -190,6 +191,7 @@ function useExpenseSubmission(params: UseExpenseSubmissionParams) { // Localization const {translate, toLocaleDigit} = useLocalize(); + const delegateAccountID = useDelegateAccountID(); // Permissions const {isBetaEnabled} = usePermissions(); @@ -828,6 +830,7 @@ function useExpenseSubmission(params: UseExpenseSubmissionParams) { participantsPolicyTags, shouldHandleNavigation, shouldDeferForSearch: shouldDeferSplitForSearch, + delegateAccountID, }); } } @@ -868,6 +871,7 @@ function useExpenseSubmission(params: UseExpenseSubmissionParams) { personalDetails, shouldHandleNavigation, shouldDeferForSearch: shouldDeferSplitForSearch, + delegateAccountID, }); } markSubmitExpenseEnd(); @@ -905,6 +909,7 @@ function useExpenseSubmission(params: UseExpenseSubmissionParams) { personalDetails, shouldHandleNavigation, shouldDeferForSearch: shouldDeferSplitForSearch, + delegateAccountID, }); } markSubmitExpenseEnd(); diff --git a/tests/actions/IOU/SplitReportTotalsTest.ts b/tests/actions/IOU/SplitReportTotalsTest.ts index fe29acfd1ce9..154ae9de96f5 100644 --- a/tests/actions/IOU/SplitReportTotalsTest.ts +++ b/tests/actions/IOU/SplitReportTotalsTest.ts @@ -505,6 +505,7 @@ describe('actions/IOU', () => { betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, participantsPolicyTags: overrides.participantsPolicyTags ?? {}, + delegateAccountID: undefined, }); it('returns valid splitData with chatReportID, transactionID, and reportActionID', () => { @@ -768,6 +769,7 @@ describe('actions/IOU', () => { transactionReport: {reportID: 'tx-report-1', parentReportID: 'parent-report-1'}, expenseReport: {reportID: EXPENSE_REPORT_ID, parentReportID: 'parent-report-1', chatReportID: 'chat-report-1'}, isOffline: false, + delegateAccountID: undefined, ...overrides, }; } diff --git a/tests/actions/IOUTest/SplitSelfDMTest.ts b/tests/actions/IOUTest/SplitSelfDMTest.ts index 782b9b440837..bdd5dadbe199 100644 --- a/tests/actions/IOUTest/SplitSelfDMTest.ts +++ b/tests/actions/IOUTest/SplitSelfDMTest.ts @@ -219,6 +219,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -307,6 +308,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -416,6 +418,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -510,6 +513,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -570,6 +574,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -661,6 +666,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { transactionReport: selfDMReport, expenseReport: undefined, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); diff --git a/tests/actions/IOUTest/SplitTest.ts b/tests/actions/IOUTest/SplitTest.ts index f2b1bd2022e0..f61ce30d712b 100644 --- a/tests/actions/IOUTest/SplitTest.ts +++ b/tests/actions/IOUTest/SplitTest.ts @@ -412,6 +412,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }, ); return waitForBatchedUpdates(); @@ -747,6 +748,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -796,6 +798,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -819,6 +822,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -849,6 +853,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -884,6 +889,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -905,6 +911,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -970,6 +977,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1020,6 +1028,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1081,6 +1090,7 @@ describe('split expense', () => { policyRecentlyUsedCurrencies: [], betas: [CONST.BETAS.ALL], personalDetails: mockPersonalDetails, + delegateAccountID: undefined, }); waitForBatchedUpdates(); @@ -1131,6 +1141,7 @@ describe('split expense', () => { policyRecentlyUsedCurrencies: [], policyRecentlyUsedTags: undefined, participantsPolicyTags, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1153,7 +1164,7 @@ describe('split expense', () => { expect(iouAction).toBeTruthy(); // Complete this split bill without changing the description - completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], mockPersonalDetails, RORY_EMAIL); + completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], mockPersonalDetails, undefined, RORY_EMAIL); await waitForBatchedUpdates(); @@ -1295,6 +1306,7 @@ describe('split expense', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1362,6 +1374,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: testPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1423,6 +1436,7 @@ describe('split expense', () => { policyRecentlyUsedTags: undefined, betas: [CONST.BETAS.ALL], personalDetails: participantPersonalDetails, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1492,6 +1506,7 @@ describe('split expense', () => { quickAction: undefined, policyRecentlyUsedCurrencies: [], participantsPolicyTags, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1550,7 +1565,7 @@ describe('split expense', () => { }, }; - completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], completeSplitPersonalDetails, RORY_EMAIL); + completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], completeSplitPersonalDetails, undefined, RORY_EMAIL); await waitForBatchedUpdates(); @@ -1595,6 +1610,7 @@ describe('startSplitBill', () => { quickAction: {}, policyRecentlyUsedCurrencies: [], participantsPolicyTags, + delegateAccountID: undefined, }); waitForBatchedUpdates(); @@ -1639,6 +1655,7 @@ describe('startSplitBill', () => { policyRecentlyUsedCurrencies: [], policyRecentlyUsedTags: undefined, participantsPolicyTags, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1686,6 +1703,7 @@ describe('startSplitBill', () => { policyRecentlyUsedCurrencies: [], policyRecentlyUsedTags: undefined, participantsPolicyTags, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1802,6 +1820,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1923,6 +1942,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2056,6 +2076,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2223,6 +2244,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2285,6 +2307,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2451,6 +2474,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2560,6 +2584,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2737,6 +2762,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports1.transactionReport, expenseReport: reports1.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -2873,6 +2899,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports2.transactionReport, expenseReport: reports2.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3059,6 +3086,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3238,6 +3266,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3431,6 +3460,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3647,6 +3677,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3832,6 +3863,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -3966,6 +3998,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: true, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4098,6 +4131,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4279,6 +4313,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4344,6 +4379,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); const updateSplitTransactionCall = writeSpy.mock.calls.find(([command]) => command === WRITE_COMMANDS.UPDATE_SPLIT_TRANSACTION); @@ -4600,6 +4636,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4711,6 +4748,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4786,6 +4824,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4854,6 +4893,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4927,6 +4967,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -4996,6 +5037,7 @@ describe('updateSplitTransactions', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); diff --git a/tests/actions/TransactionTest.ts b/tests/actions/TransactionTest.ts index 270bdf2ed1fb..f5feb4372565 100644 --- a/tests/actions/TransactionTest.ts +++ b/tests/actions/TransactionTest.ts @@ -514,6 +514,7 @@ describe('actions/Transaction', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -693,6 +694,7 @@ describe('actions/Transaction', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -886,6 +888,7 @@ describe('actions/Transaction', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); @@ -1102,6 +1105,7 @@ describe('actions/Transaction', () => { transactionReport: reports.transactionReport, expenseReport: reports.expenseReport, isOffline: false, + delegateAccountID: undefined, }); await waitForBatchedUpdates(); From b1ea679b4cdefc86f4c1dc7b64ab2c00940b3fd5 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 5 Jul 2026 08:15:11 +0530 Subject: [PATCH 2/4] Add delegateAccountID forwarding tests for split and inline edit flows Signed-off-by: krishna2323 --- tests/actions/IOUTest/SplitTest.ts | 49 +++++++++++++ .../actions/IOUTest/UpdateMoneyRequestTest.ts | 68 +++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/tests/actions/IOUTest/SplitTest.ts b/tests/actions/IOUTest/SplitTest.ts index f61ce30d712b..cfcf55291ae0 100644 --- a/tests/actions/IOUTest/SplitTest.ts +++ b/tests/actions/IOUTest/SplitTest.ts @@ -7962,3 +7962,52 @@ describe('createDistanceRequest', () => { expect(createdTransaction).toBeTruthy(); }); }); + +describe('startSplitBill delegateAccountID forwarding', () => { + const DELEGATE_ACCOUNT_ID = 999; + + it('sets delegateAccountID on the split IOU action when delegateAccountID is provided', async () => { + const reportID = 'delegate-split-report'; + await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, { + reportID, + type: CONST.REPORT.TYPE.CHAT, + chatType: CONST.REPORT.CHAT_TYPE.GROUP, + participants: { + [RORY_ACCOUNT_ID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS}, + [CARLOS_ACCOUNT_ID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS}, + }, + }); + + const participants: IOUParticipant[] = [{accountID: CARLOS_ACCOUNT_ID, login: CARLOS_EMAIL}]; + const participantsPolicyTags = await getParticipantsPolicyTags(participants); + + const {splitTransactionID} = startSplitBill({ + participants, + currentUserLogin: RORY_EMAIL, + currentUserAccountID: RORY_ACCOUNT_ID, + comment: 'test', + currency: CONST.CURRENCY.USD, + existingSplitChatReportID: reportID, + receipt: {}, + category: undefined, + tag: undefined, + taxCode: '', + taxAmount: 0, + quickAction: undefined, + policyRecentlyUsedCurrencies: [], + policyRecentlyUsedTags: undefined, + participantsPolicyTags, + delegateAccountID: DELEGATE_ACCOUNT_ID, + }); + + await waitForBatchedUpdates(); + + const reportActions = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`); + const splitIOUAction = Object.values(reportActions ?? {}).find( + (action) => isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.IOU) && getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT, + ); + + expect(splitTransactionID).toBeTruthy(); + expect(splitIOUAction?.delegateAccountID).toBe(DELEGATE_ACCOUNT_ID); + }); +}); diff --git a/tests/actions/IOUTest/UpdateMoneyRequestTest.ts b/tests/actions/IOUTest/UpdateMoneyRequestTest.ts index d6a49b3c5d9c..086fa824fef3 100644 --- a/tests/actions/IOUTest/UpdateMoneyRequestTest.ts +++ b/tests/actions/IOUTest/UpdateMoneyRequestTest.ts @@ -11,6 +11,7 @@ import { updateMoneyRequestTag, } from '@libs/actions/IOU/UpdateMoneyRequest'; import initOnyxDerivedValues from '@libs/actions/OnyxDerived'; +import {editTransactionMerchantInline} from '@libs/actions/TransactionInlineEdit'; import * as API from '@libs/API'; import {WRITE_COMMANDS} from '@libs/API/types'; import type * as PolicyUtils from '@libs/PolicyUtils'; @@ -2477,4 +2478,71 @@ describe('actions/IOU/UpdateMoneyRequest', () => { writeSpy.mockRestore(); }); }); + + describe('editTransactionMerchantInline delegateAccountID forwarding', () => { + const DELEGATE_ACCOUNT_ID = 999; + + it('sets delegateAccountID when delegateAccountID is provided', async () => { + const transactionID = 'txnMerchantDelegate1'; + const transactionThreadReportID = 'threadMerchantDelegate1'; + const parentReportID = 'parentMerchantDelegate1'; + const policyID = '40'; + const newMerchant = 'New Merchant'; + + const parentReport: Report = { + ...createRandomReport(1, undefined), + reportID: parentReportID, + type: CONST.REPORT.TYPE.EXPENSE, + policyID, + ownerAccountID: RORY_ACCOUNT_ID, + }; + const transactionThreadReport: Report = { + ...createRandomReport(2, undefined), + reportID: transactionThreadReportID, + parentReportID, + type: CONST.REPORT.TYPE.CHAT, + }; + const fakeTransaction: Transaction = { + ...createRandomTransaction(3), + transactionID, + reportID: parentReportID, + merchant: 'Old Merchant', + }; + const fakePolicy: Policy = createRandomPolicy(Number(policyID)); + + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`, parentReport); + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`, transactionThreadReport); + await Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, fakeTransaction); + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, fakePolicy); + + editTransactionMerchantInline( + { + hash: undefined, + transactionID, + parentReport, + parentReportAction: undefined, + transactionThreadReport, + policy: fakePolicy, + policyCategories: {}, + policyTags: {}, + policyRecentlyUsedCategories: [], + policyRecentlyUsedTags: [], + parentReportNextStep: undefined, + isOffline: false, + isSelfTourViewed: false, + hasCompletedGuidedSetupFlow: false, + distanceOriginalPolicy: undefined, + policyForTrackExpense: undefined, + delegateAccountID: DELEGATE_ACCOUNT_ID, + }, + newMerchant, + ); + + await waitForBatchedUpdates(); + + const reportActions = await getOnyxValue(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`); + const modifiedExpenseAction = Object.values(reportActions ?? {}).find((action) => isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE)); + expect(modifiedExpenseAction?.delegateAccountID).toBe(DELEGATE_ACCOUNT_ID); + }); + }); }); From 5b2dbff6994ec894b7e174bb47318c3fe1db5b6c Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 5 Jul 2026 08:20:45 +0530 Subject: [PATCH 3/4] Refactor completeSplitBill to accept a params object Signed-off-by: krishna2323 --- src/libs/actions/IOU/Split.ts | 51 +++++++++++-------- src/pages/iou/DynamicSplitBillDetailsPage.tsx | 12 ++--- tests/actions/IOUTest/SplitTest.ts | 28 +++++++++- 3 files changed, 61 insertions(+), 30 deletions(-) diff --git a/src/libs/actions/IOU/Split.ts b/src/libs/actions/IOU/Split.ts index dd1d97da7ccc..29968fd339ee 100644 --- a/src/libs/actions/IOU/Split.ts +++ b/src/libs/actions/IOU/Split.ts @@ -199,6 +199,20 @@ type StartSplitBilActionParams = { delegateAccountID: number | undefined; }; +type CompleteSplitBillActionParams = { + chatReportID: string; + reportAction: OnyxEntry; + updatedTransaction: OnyxEntry; + sessionAccountID: number; + isASAPSubmitBetaEnabled: boolean; + quickAction: OnyxEntry; + transactionViolations: OnyxCollection; + betas: OnyxEntry; + personalDetails: OnyxEntry; + delegateAccountID: number | undefined; + sessionEmail?: string; +}; + type SplitBillActionsParams = { participants: Participant[]; currentUserLogin: string; @@ -855,27 +869,20 @@ function startSplitBill({ return {splitTransactionID: splitTransaction.transactionID}; } -/** Used for editing a split expense while it's still scanning or when SmartScan fails, it completes a split expense started by startSplitBill above. - * - * @param chatReportID - The group chat or workspace reportID - * @param reportAction - The split action that lives in the chatReport above - * @param updatedTransaction - The updated **draft** split transaction - * @param sessionAccountID - accountID of the current user - * @param sessionEmail - email of the current user - */ -function completeSplitBill( - chatReportID: string, - reportAction: OnyxEntry, - updatedTransaction: OnyxEntry, - sessionAccountID: number, - isASAPSubmitBetaEnabled: boolean, - quickAction: OnyxEntry, - transactionViolations: OnyxCollection, - betas: OnyxEntry, - personalDetails: OnyxEntry, - delegateAccountID: number | undefined, - sessionEmail?: string, -) { +/** Used for editing a split expense while it's still scanning or when SmartScan fails, it completes a split expense started by startSplitBill above. */ +function completeSplitBill({ + chatReportID, + reportAction, + updatedTransaction, + sessionAccountID, + isASAPSubmitBetaEnabled, + quickAction, + transactionViolations, + betas, + personalDetails, + delegateAccountID, + sessionEmail, +}: CompleteSplitBillActionParams) { if (!reportAction) { return; } @@ -2252,4 +2259,4 @@ export { resetSplitShares, }; -export type {CreateDistanceRequestInformation, StartSplitBilActionParams}; +export type {CompleteSplitBillActionParams, CreateDistanceRequestInformation, StartSplitBilActionParams}; diff --git a/src/pages/iou/DynamicSplitBillDetailsPage.tsx b/src/pages/iou/DynamicSplitBillDetailsPage.tsx index 7c820f8355d0..d37802138d2c 100644 --- a/src/pages/iou/DynamicSplitBillDetailsPage.tsx +++ b/src/pages/iou/DynamicSplitBillDetailsPage.tsx @@ -95,19 +95,19 @@ function DynamicSplitBillDetailsPage({report, reportAction}: SplitBillDetailsPag const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const onConfirm = useCallback(() => { setIsConfirmed(true); - completeSplitBill( - reportID, + completeSplitBill({ + chatReportID: reportID, reportAction, - draftTransaction, - session?.accountID ?? CONST.DEFAULT_NUMBER_ID, + updatedTransaction: draftTransaction, + sessionAccountID: session?.accountID ?? CONST.DEFAULT_NUMBER_ID, isASAPSubmitBetaEnabled, quickAction, transactionViolations, betas, personalDetails, delegateAccountID, - session?.email, - ); + sessionEmail: session?.email, + }); }, [ reportID, reportAction, diff --git a/tests/actions/IOUTest/SplitTest.ts b/tests/actions/IOUTest/SplitTest.ts index cfcf55291ae0..d5536aa47a12 100644 --- a/tests/actions/IOUTest/SplitTest.ts +++ b/tests/actions/IOUTest/SplitTest.ts @@ -1164,7 +1164,19 @@ describe('split expense', () => { expect(iouAction).toBeTruthy(); // Complete this split bill without changing the description - completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], mockPersonalDetails, undefined, RORY_EMAIL); + completeSplitBill({ + chatReportID: reportID, + reportAction: iouAction, + updatedTransaction: updatedSplitTransaction, + sessionAccountID: RORY_ACCOUNT_ID, + isASAPSubmitBetaEnabled: false, + quickAction: undefined, + transactionViolations: {}, + betas: [CONST.BETAS.ALL], + personalDetails: mockPersonalDetails, + delegateAccountID: undefined, + sessionEmail: RORY_EMAIL, + }); await waitForBatchedUpdates(); @@ -1565,7 +1577,19 @@ describe('split expense', () => { }, }; - completeSplitBill(reportID, iouAction, updatedSplitTransaction, RORY_ACCOUNT_ID, false, undefined, {}, [CONST.BETAS.ALL], completeSplitPersonalDetails, undefined, RORY_EMAIL); + completeSplitBill({ + chatReportID: reportID, + reportAction: iouAction, + updatedTransaction: updatedSplitTransaction, + sessionAccountID: RORY_ACCOUNT_ID, + isASAPSubmitBetaEnabled: false, + quickAction: undefined, + transactionViolations: {}, + betas: [CONST.BETAS.ALL], + personalDetails: completeSplitPersonalDetails, + delegateAccountID: undefined, + sessionEmail: RORY_EMAIL, + }); await waitForBatchedUpdates(); From 7164b3f7fe35d91558cecb7fac3d566821fdb920 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 5 Jul 2026 08:29:52 +0530 Subject: [PATCH 4/4] fix knip check and ESLint. Signed-off-by: krishna2323 --- src/libs/actions/IOU/Split.ts | 2 +- tests/actions/IOUTest/UpdateMoneyRequestTest.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU/Split.ts b/src/libs/actions/IOU/Split.ts index 29968fd339ee..976ce87674b3 100644 --- a/src/libs/actions/IOU/Split.ts +++ b/src/libs/actions/IOU/Split.ts @@ -2259,4 +2259,4 @@ export { resetSplitShares, }; -export type {CompleteSplitBillActionParams, CreateDistanceRequestInformation, StartSplitBilActionParams}; +export type {CreateDistanceRequestInformation, StartSplitBilActionParams}; diff --git a/tests/actions/IOUTest/UpdateMoneyRequestTest.ts b/tests/actions/IOUTest/UpdateMoneyRequestTest.ts index 086fa824fef3..491e975bff76 100644 --- a/tests/actions/IOUTest/UpdateMoneyRequestTest.ts +++ b/tests/actions/IOUTest/UpdateMoneyRequestTest.ts @@ -2526,7 +2526,7 @@ describe('actions/IOU/UpdateMoneyRequest', () => { policyCategories: {}, policyTags: {}, policyRecentlyUsedCategories: [], - policyRecentlyUsedTags: [], + policyRecentlyUsedTags: undefined, parentReportNextStep: undefined, isOffline: false, isSelfTourViewed: false,