Skip to content

Make report go away when last split transaction on report is deleted #79593

@blimpich

Description

@blimpich

Coming from this issue, we've noticed that when a transaction gets split and then gets put into it's own report it doesn't remove the report it's part of. When a report only has 1 transaction and that transaction gets deleted so should the report. This was identified as both a backend issue and a frontend issue, so the purpose of this issue is to handle the backend portion of work. The frontend will handle the optimistic data handling.

Repro steps

  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Create an expense
  4. Open the expense report
  5. Click More > Split
  6. Click Save
  7. Open any split
  8. Click Report field > Create report
  9. Go back to workspace chat
  10. Right click on the report with one split > Delete
  11. Delete the report
  12. Click on the empty report

Expected behavior: When removing a split transaction during a revert-split flow, we should determine whether the removed transaction is the last expense in its report. If it's true, the report should also be removed.

Actual behavior: When removing a split transaction during a revert-split flow, only the transaction is removed, and an empty report is left behind.

Command that needs to be updated

RevertSplitTransaction

Metadata

Metadata

Assignees

Labels

DailyKSv2Hot PickReady for an engineer to pick up and run withInternalRequires API changes or must be handled by Expensify staffOverdue

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions