Add report action for deleting expenses off of processing reports
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: N/A Reproducible in staging?: N/A Reproducible in production?: N/A If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: None Issue reported by: @sakluger Slack conversation (hyperlinked to channel name): It's in eng, but it's more #expense
Action Performed:
- Create new workspace (Instant Submit will be enabled by default)
- Enable Approvals
- Invite Submitter A
- Have Submitter A create an expense
- Have Submitter A delete the expense
Expected Result:
When we make a change to an expense on a processing report, we add a report action indicating the change. We'd expect to see something like:
User Name deleted an expense on this report, [Merchant] - [Amount]
If it was me deleting it, it'd look like this:
Garrett Knight deleted an expense on this report, Nando's - £12.77
Actual Result:
The expense is deleted without a trace, confusing approvers when they've seen that an expense was once on the report.
Workaround:
None
Platforms:
All
Screenshots/Videos
Add any screenshot/video evidence
Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The expense is deleted without a trace, confusing approvers when they've seen that an expense was once on the report.
What is the root cause of that problem?
When we delete a money request, we don't add any report action to keep track of the change
What changes do you think we should make in order to solve the problem?
-
Define a new report action for delete expense like
DELETE_EXPENSE -
In
deleteMoneyRequest, create an optimistic action, removependingActioninsucessData, and add an error infailureDatain the expense report ifshouldDeleteIOUReportisfalseand the report is a processing report. This action will have some data inoriginalMessagelikeamount,merchant,currency
https://github.com/Expensify/App/blob/ce282d38777e9e0a267e1b6f44bff9c4aace98ee/src/libs/actions/IOU.ts#L5735
- Add the
deleteExpenseReportActionIDparam as thereportActionIDof the optimistic action above here
https://github.com/Expensify/App/blob/ce282d38777e9e0a267e1b6f44bff9c4aace98ee/src/libs/actions/IOU.ts#L5962
- Define a function to get the translation for the action and
-
Add a case for this action here for the alternative text in LHN
-
Add a case in
ReportActionItemhere for the action inReportScreen -
Add a case in
getReportNamefunction here for thread header translation -
Add a case in here for the copy message
- Require backend change
- Introduce a new param in
DeleteMoneyRequestAPI likedeleteExpenseReportActionIDand use this ID to generate a new delete expense action and return it to front end.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can define a new test case in IOUTest here. We need to create mock data accordingly and verify a new delete expense action is created in this case when we call DeleteMoneyRequest API.
https://github.com/Expensify/App/blob/ce282d38777e9e0a267e1b6f44bff9c4aace98ee/tests/actions/IOUTest.ts#L1910
What alternative solutions did you explore? (Optional)
NA
@youssef-lr, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!
hey @youssef-lr are you working on this one, or should we be assigning external for them to review the proposal above? Thanks!
@zanyrenney I should have the backend PRs ready today, but we can also assign someone to work on the frontend PRs. @nkdengineer's proposal LGTM, except that we should only record this action if the report is PROCESSING.
Made some progress locally and should have the first Auth PR ready by EOD
great update, thank you so much @youssef-lr !
Job added to Upwork: https://www.upwork.com/jobs/~021867259873329835185
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)
❌ There was an error making the offer to @nkdengineer for the Contributor role. The BZ member will need to manually hire the contributor.
📣 @brunovjk 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
❌ There was an error making the offer to @nkdengineer for the Contributor role. The BZ member will need to manually hire the contributor.
I had to make PRs in the other repos to test stuff so that shifted my focus away from finishing the tests of the Auth PR. It should be ready tomorrow for review. @nkdengineer you can continue working starting from this draft PR https://github.com/Expensify/App/pull/54079, please make a branch off of it.
@youssef-lr Do I need to create a new branch or will work on this?
I'm not sure you can continue working on that PR permission-wise? I think it's best to make a new branch from it. Once you have a draft PR ready please assign me to review I may suggest some changes early.
Just made the Auth PR ready for review. I'll request review first thing on Monday.
@youssef-lr we have a draft PR here
@youssef-lr @zanyrenney @brunovjk @nkdengineer this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Any updates @youssef-lr for us? Thanks :D
we're just waiting on another backend PR to get deployed
@youssef-lr, @zanyrenney, @brunovjk, @nkdengineer Whoops! This issue is 2 days overdue. Let's get this updated quick!
we're just waiting on another backend PR to get deployed
Update: Still waiting to test the PR
@youssef-lr, @zanyrenney, @brunovjk, @nkdengineer Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@youssef-lr @zanyrenney @brunovjk @nkdengineer this issue is now 4 weeks old, please consider:
- Finding a contributor to fix the bug
- Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
- If you have any questions, don't hesitate to start a discussion in #expensify-open-source
Thanks!
@youssef-lr, @zanyrenney, @brunovjk, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
👋 @youssef-lr, I tested nkdengineer's draft PR and it seems the BE is already implemented—could you confirm and advise on the next steps? Thank you :D
bump @youssef-lr please can you respond to the message above and let us know the next steps here please? Thank you!
Yes the backend is done. Can we resume the frontend PR?
Now it's up to you @nkdengineer. Thank you all.
Will open PR soon