Repository navigation
Lock the report field for corporate card expenses - #108903
Draft
elirangoshen wants to merge 2 commits into
Draft
elirangoshen wants to merge 2 commits into
elirangoshen wants to merge 2 commits into
Conversation
The server rejects moving a corporate liability card expense to another report, so offering the move only led to a failed request and, for a new report, an empty report left behind.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…corporate-card-move
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
The server rejects moving a corporate card expense to another report ("Expenses from corporate credit cards cannot be moved between reports."), but the app still offers the move. Each attempt fails. When the user picks "new report", the app creates the report first, so the failed move also leaves an empty $0 report behind.
From server logs, Dec-1 to Dec-3: this is the most common reason a move fails (28 failures from 8 users on Dec-2), and it caused 25 of the 55 empty reports left behind on those days.
This PR locks the Report field for these expenses.
canEditFieldOfMoneyRequestnow returnsfalsefor theREPORTfield whenisCorporateCardTransactionis true: a company card expense whose feed sets corporate liability ("Allow cardholders to delete transactions" turned off). Every way to move an expense goes through this check: the expense page, the actions on a selected expense in a report, and the bulk actions in Search.What does not change:
Fixed Issues
$ #106962
PROPOSAL:
Automated Tests
tests/unit/canEditFieldOfMoneyRequestTest.ts:Tests
Offline tests
Same as Tests. The check only reads local data.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari