Skip to content

[Due for payment 2026-07-28] [Merge Reports][FE] mergeReports() action + optimistic data + Constants + command types #94872

Closed

Description

@MelvinBot

Frontend sub-issue of the Merge Reports project. Tracking issue: #92950.

[Merge Reports][FE] Constants + command types (MERGE_REPORTS, MergeReportsParams)

Scope

Add the constants and command types that the merge action and bulk-action menu depend on.

  • CONST.SEARCH.BULK_ACTION_TYPES.MERGE_REPORTS — namespaced under SEARCH, matching the existing bulk-action constants.
  • WRITE_COMMANDS.MERGE_REPORTS: 'MergeReports' in src/libs/API/types.ts.
  • MergeReportsParams in WriteCommandParameters:
    • destinationReportID: string
    • sourceReportIDs: string[] (a real array, derived as selected minus destination — not a JSON-stringified string)

Notes

Small and mechanical. The param shape must match the backend MergeReports command (#92950)


mergeReports() action + optimistic data

Scope

Add the mergeReports(destinationReportID, sourceReportIDs) action that fires WRITE_COMMANDS.MERGE_REPORTS with optimistic data.

  • Reuse the optimistic-data helpers from changeTransactionsReport() in src/libs/actions/Transaction.ts rather than reimplementing "move + delete empty" in Report.ts. That function already moves transactions, updates source totals/counts, manages transaction threads, and tracks staleReportIDs.
  • Optimistic data: move every transaction from each source report into the destination, then mark each emptied source report as deleted (comments included).
  • Include ONYXKEYS.COLLECTION.SNAPSHOT updates.
  • The actual move + delete of empty source reports is performed by the backend MergeReports command — this action only builds the FE optimistic/success/failure data and calls the command.

Splits — confirmed non-issue

Split expenses are preserved through the merge: the split link lives on transaction data (comment.originalTransactionID), not on the source report, as long as the move goes through the same backend path ChangeTransactionsReport already uses. No special handling needed.

Tests

Unit + snapshot tests, including the empty-source-report deletion.

Dependencies

  • Backend MergeReports command (response shape to reconcile against).
  • Constants + command types, above.

Part of the Merge Reports project — discussed in Slack.

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. changed the title [-][Merge Reports][FE] `mergeReports()` action + optimistic data[/-] [+][Merge Reports][FE] `mergeReports()` action + optimistic data + Constants + command types[/+] on Jun 29, 2026
  2. melvin-bot commented on Jul 2, 2026

    @melvin-bot

    @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

  3. melvin-bot commented on Jul 3, 2026

    @melvin-bot

    @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

  4. melvin-bot commented on Jul 3, 2026

    @melvin-bot

    @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. 11 remaining items

  6. added
    ReviewingHas a PR in review
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jul 22, 2026
  7. melvin-bot commented on Jul 27, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  8. melvin-bot commented on Jul 27, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @situchan owed $250 via NewDot
    • ROLE: @dmkt9 paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  9. situchan commented on Jul 30, 2026

    @situchan
    Contributor

    @mallenexpensify payment will be handled in parent issue

  10. mallenexpensify commented on Jul 30, 2026

    @mallenexpensify
    Contributor

    Deleted payment summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions