Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6c63b82
feat: Add the constants and MergeReports command types
dmkt9 Jul 1, 2026
7386818
feat: implement mergeReports() action
dmkt9 Jul 2, 2026
69689ff
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 2, 2026
f04fdc5
feat: implement mergeReports() action
dmkt9 Jul 2, 2026
67406e8
feat: implement mergeReports() action
dmkt9 Jul 2, 2026
2683e73
feat: implement mergeReports() action
dmkt9 Jul 2, 2026
4fb757f
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 2, 2026
e327ffa
feat: implement mergeReports() action
dmkt9 Jul 2, 2026
d9ddc0e
feat: implement mergeReports() action
dmkt9 Jul 3, 2026
f51b7b2
feat: implement mergeReports() action
dmkt9 Jul 3, 2026
beb63d2
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 3, 2026
8293411
feat: implement mergeReports() action
dmkt9 Jul 3, 2026
eefbc62
feat: implement mergeReports() action
dmkt9 Jul 3, 2026
864066b
fix eslint
dmkt9 Jul 4, 2026
57e5233
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 4, 2026
d6d2b2c
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 6, 2026
7d1f67e
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 7, 2026
6055da4
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 8, 2026
8465e38
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 10, 2026
214c17f
feat: implement mergeReports() action
dmkt9 Jul 10, 2026
4613ea5
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 13, 2026
e6ac86e
Merge branch 'main' into feat/mergeReports-action
dmkt9 Jul 14, 2026
d02aef2
fix conflicts
dmkt9 Jul 15, 2026
a9ee660
fix conflicts
dmkt9 Jul 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/eslint/eslint.seatbelt.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@
"../../tests/actions/ReportPreviewActionUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 29
"../../tests/actions/ReportPreviewActionUtilsTest.ts" "no-restricted-imports" 2
"../../tests/actions/ReportTest.ts" "@typescript-eslint/no-deprecated/buildNextStepNew" 1
"../../tests/actions/ReportTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 58
"../../tests/actions/ReportTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 50
"../../tests/actions/ReportTest.ts" "no-restricted-imports" 1
"../../tests/actions/SessionTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 12
"../../tests/actions/SubscriptionTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 2
Expand Down
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6592,6 +6592,7 @@ const CONST = {
SUBMIT: 'submit',
HOLD: 'hold',
MERGE: 'merge',
MERGE_REPORTS: 'mergeReports',
UNHOLD: 'unhold',
DELETE: 'delete',
REJECT: 'reject',
Expand Down
7 changes: 7 additions & 0 deletions src/libs/API/parameters/MergeReportsParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type MergeReportsParams = {
destinationReportID: string;
sourceReportIDs: string[];
transactionIDToReportActionAndThreadData: string; // A map of transactionID to TransactionThreadInfo
};

export default MergeReportsParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ export type {SaveCorpayOnboardingCompanyDetailsParams} from './SaveCorpayOnboard
export type {default as AcceptSpotnanaTermsParams} from './AcceptSpotnanaTermsParams';
export type {default as SaveCorpayOnboardingBeneficialOwnerParams} from './SaveCorpayOnboardingBeneficialOwnerParams';
export type {default as DeleteAppReportParams} from './DeleteAppReportParams';
export type {default as MergeReportsParams} from './MergeReportsParams';
export type {default as SaveCorpayOnboardingDirectorInformationParams} from './SaveCorpayOnboardingDirectorInformationParams';
export type {default as AskForCorpaySignerInformationParams} from './AskForCorpaySignerInformationParams';
export type {default as MoveIOUReportToPolicyAndInviteSubmitterParams} from './MoveIOUReportToPolicyAndInviteSubmitterParams';
Expand Down
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ const WRITE_COMMANDS = {
SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS: 'SaveCorpayOnboardingCompanyDetails',
SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER: 'SaveCorpayOnboardingBeneficialOwner',
DELETE_APP_REPORT: 'DeleteAppReport',
MERGE_REPORTS: 'MergeReports',
SAVE_CORPAY_ONBOARDING_DIRECTOR_INFORMATION: 'SaveCorpayOnboardingDirectorInformation',
ASK_FOR_CORPAY_SIGNER_INFORMATION: 'AskForCorpaySignerInformation',
SEND_REMINDER_FOR_CORPAY_SINGER_INFORMATION: 'SendReminderForCorpaySignerInformation',
Expand Down Expand Up @@ -1276,6 +1277,7 @@ type WriteCommandParameters = {
// Dismiss Product Training
[WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING]: Parameters.DismissProductTrainingParams;
[WRITE_COMMANDS.DELETE_APP_REPORT]: Parameters.DeleteAppReportParams;
[WRITE_COMMANDS.MERGE_REPORTS]: Parameters.MergeReportsParams;

// Merge accounts API
[WRITE_COMMANDS.GET_VALIDATE_CODE_FOR_ACCOUNT_MERGE]: Parameters.GetValidateCodeForAccountMergeParams;
Expand Down
27 changes: 19 additions & 8 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@ function canSubmitAndIsAwaitingForCurrentUser(

function hasOutstandingChildRequest(
chatReport: Report,
iouReportOrID: OnyxEntry<Report> | string,
iouReportOrIDorArray: OnyxEntry<Report> | string | Array<OnyxEntry<Report>>,
currentUserEmailParam: string,
currentUserAccountIDParam: number,
allTransactionViolations: OnyxCollection<TransactionViolations>,
Expand All @@ -3061,18 +3061,29 @@ function hasOutstandingChildRequest(
const reportActions = getAllReportActions(chatReport.reportID);
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
const policy = getPolicy(chatReport.policyID);

const excludedReportIDSet = new Set<string>();
if (typeof iouReportOrIDorArray === 'string') {
excludedReportIDSet.add(iouReportOrIDorArray);
} else if (Array.isArray(iouReportOrIDorArray)) {
for (const iouReport of iouReportOrIDorArray) {
if (!iouReport?.reportID) {
continue;
}
excludedReportIDSet.add(iouReport.reportID);
}
}

return Object.values(reportActions).some((action) => {
const iouReportID = getIOUReportIDFromReportActionPreview(action);
if (
!iouReportID ||
action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ||
isDeletedAction(action) ||
(typeof iouReportOrID === 'string' && iouReportID === iouReportOrID)
) {
if (!iouReportID || action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isDeletedAction(action) || excludedReportIDSet.has(iouReportID)) {
return false;
}

const iouReport = typeof iouReportOrID !== 'string' && iouReportOrID?.reportID === iouReportID ? iouReportOrID : getReportOrDraftReport(iouReportID);
const iouReport =
typeof iouReportOrIDorArray !== 'string' && !Array.isArray(iouReportOrIDorArray) && iouReportOrIDorArray?.reportID === iouReportID
? iouReportOrIDorArray
: getReportOrDraftReport(iouReportID);
const transactions = getReportTransactions(iouReportID);
const reportMetadata = allReportMetadata?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${iouReportID}`];
const invoiceReceiverPolicyID = chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined;
Expand Down
Loading
Loading