Repository navigation
[HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [Dupe Detection] Merge Duplicates - Review Page #39756
Description
Part of the Merge Duplicates project
Main issue: https://github.com/Expensify/Expensify/issues/307591
Doc section: Surfacing Potential Duplicates
Project: [Wave: Collect Approvers] Dupe Detection
Part of a series of issues:
- [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [Dupe Detection] Merge Duplicates - Review Page #39756
- [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [Dupe Detection] Merge Duplicates - Review Fields Page #39808
- [Hold for payment 2024-07-31] [Dupe Detection] Merge Duplicates - Confirm Page #39810
Feature Description
Context for ReviewDuplicates
- Review page - /r/:threadReportID/duplicates/review
- Merchant - /r/:threadReportID/duplicates/review/merchant
- Category - /r/:threadReportID/duplicates/review/category
- Tag - /r/:threadReportID/duplicates/review/tag
- Description - /r/:threadReportID/duplicates/review/description
- Confirm page - /r/:threadReportID/duplicates/confirm
All of these screens will exist in their own navigator so they can be pushed (and later popped off once complete) as a group.
All of this will use an Onyx form key of ONYXKEYS.FORMS.REVIEW_DUPLICATES_FORM so we can store the data selected by the user so far when resolving the duplicates. It also lets us keep track of which transaction to keep and which ones are duplicates when the user clicks on Keep this one.
This key will follow a structure like this:
{
"review_duplicates_form_<transactionID>": [
{
"duplicates": {
<transactionID>: <transactionID>,
...
},
"merchant": "...",
"tag": ...",
"description": ...",
…
}
]
}
Review Page
On top of the page, we will add a button to “Keep All” duplicates. When calling onPress, we will call a new API endpoint called DismissViolation and navigate back. On oldDot, we use UpdateTransaction (which does a lot of stuff) but since we only have EditMoneyRequest here, it seems more appropriate to create a new endpoint to avoid breaking 1:1:1.
-
DismissViolationwill receive a list of transactionIDs since we will have to update each one and the type of violation we are dismissing.- As optimistic data, it will update the
transactions_*Onyx key to includedismissedViolationswith the accountID of the person that dismissed it in the comment field. - As an example:
- As optimistic data, it will update the
- On failure, we will just remove the same data we added to the optimistic data.
In order to be able to get the duplicates and display them, we will:
- Using Onyx, we can get the transaction for the threadReportID the same way as we do it for the EditRequestPage here.
- Once we have that, we can get the transaction IDs of the duplicates using this transaction and listening to the
transactions_*Onyx key. - Using Onyx we can fetch the transactions and with each one of those reports we can get the parentReportAction using the
reportActions_key.
To display the different duplicates on the page, we can make use of ReportActionItem which needs each one of the reportActionIDs so we can iterate and display them using the component.
Each one of ReportActionItem will generate a MoneyRequestAction and each one of this will make use MoneyRequestPreview to render the request. To show the button “Keep this one”:
-
MoneyRequestPreview will add a new button component at the end of the childContainer, similar to what we do in ReportPreview here to submit the report.
- We can use the page's route prop to determine whether we need to show the button or hide it.
onButtonPressed: it should store the iouReport we want to keep inONYXKEYS.FORMS.REVIEW_DUPLICATES_FORMand navigate to the page to start reviewing fields.
-
Preview should be navigable the same way as it is defined in
MoneyRequestAction.
Manual Test Steps
TODO
Automated Tests
TODO
Issue Owner
Current Issue Owner: @JmillsExpensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone


Activity
melvin-bot commentedon Apr 8, 2024
Triggered auto assignment to @abekkala (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.melvin-bot commentedon Apr 8, 2024
pecanoro commentedon Apr 17, 2024
Callstack will be taking this series of tasks
[-][HOLD][Dupe Detection] Merge Duplicates - Review Page[/-][+][Dupe Detection] Merge Duplicates - Review Page[/+]kubabutkiewicz commentedon Apr 22, 2024
Hi, I'm Jakub from Callstack - expert contributor group - and I would like to take a look at this issue.
44 remaining items
pecanoro commentedon Jul 12, 2024
@JmillsExpensify Can you handle payment for this issue for @parasharrajat since he reviewed the PR?
pecanoro commentedon Jul 16, 2024
@JmillsExpensify Friendly bump on the above 🤗
JmillsExpensify commentedon Jul 26, 2024
Payment summary: $250 to @parasharrajat for PR review. We have a testing script being handed off to Applause now, so no need as part of this issue. @parasharrajat please submit a request via NewDot. Thanks!
parasharrajat commentedon Aug 3, 2024
Payment requested as per #39756 (comment)
JmillsExpensify commentedon Aug 3, 2024
@mallenexpensify do you mind confirming my payment summary so that I can approve payment?
mallenexpensify commentedon Aug 6, 2024
Contributor+: @parasharrajat due $250 via NewDot
JmillsExpensify commentedon Aug 7, 2024
$250 approved for @parasharrajat