Skip to content

[HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [Dupe Detection] Merge Duplicates - Review Page #39756

Closed

Description

@pecanoro

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:

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

image

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.

  • DismissViolation will 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 include dismissedViolations with the accountID of the person that dismissed it in the comment field.
    • As an example:

image-2024-04-08 10_51_27 803

- 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 in ONYXKEYS.FORMS.REVIEW_DUPLICATES_FORM and 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 OwnerCurrent Issue Owner: @JmillsExpensify

Activity

  1. self-assigned this
    on Apr 5, 2024
  2. melvin-bot commented on Apr 8, 2024

    @melvin-bot
  3. melvin-bot commented on Apr 8, 2024

    @melvin-bot

    ⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

  4. moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #wave-collecton Apr 8, 2024
  5. pecanoro commented on Apr 17, 2024

    @pecanoro
    ContributorAuthor

    Callstack will be taking this series of tasks

  6. changed the title [-][HOLD][Dupe Detection] Merge Duplicates - Review Page[/-] [+][Dupe Detection] Merge Duplicates - Review Page[/+] on Apr 17, 2024
  7. kubabutkiewicz commented on Apr 22, 2024

    @kubabutkiewicz
    Contributor

    Hi, I'm Jakub from Callstack - expert contributor group - and I would like to take a look at this issue.

  8. 44 remaining items

  9. pecanoro commented on Jul 12, 2024

    @pecanoro
    ContributorAuthor

    @JmillsExpensify Can you handle payment for this issue for @parasharrajat since he reviewed the PR?

  10. pecanoro commented on Jul 16, 2024

    @pecanoro
    ContributorAuthor

    @JmillsExpensify Friendly bump on the above 🤗

  11. JmillsExpensify commented on Jul 26, 2024

    @JmillsExpensify
    Contributor

    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!

  12. moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #wave-collecton Jul 26, 2024
  13. parasharrajat commented on Aug 3, 2024

    @parasharrajat
    Member

    Payment requested as per #39756 (comment)

  14. JmillsExpensify commented on Aug 3, 2024

    @JmillsExpensify
    Contributor

    @mallenexpensify do you mind confirming my payment summary so that I can approve payment?

  15. mallenexpensify commented on Aug 6, 2024

    @mallenexpensify
    Contributor

    Contributor+: @parasharrajat due $250 via NewDot

  16. JmillsExpensify commented on Aug 7, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

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 productionDailyKSv2EngineeringNewFeatureSomething to build that is a new item.

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions