Skip to content

[HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$500][Dupe Detection] Surfacing Potential Duplicates #32607

@pecanoro

Description

@pecanoro

Part of the project

Main issue: https://github.com/Expensify/Expensify/issues/307591
Doc section: Surfacing Potential Duplicates
Project: [Wave: Collect Approvers] Dupe Detection

UI

image

Feature Description

Update the comment type here since this can be a single string or a full array containing different transactions NVPs. In this case, it looks like this:

image-2024-04-08 10_51_27 803

The HOLD doc implemented the logic to display the HOLD notification for each expense. You can see the details here. However, we need to make the following changes to update the HOLD notification in case it is duplicated.

  • Add a new function called TransactionUtils.isDuplicate(transactionID, checkDismissed) that will check if there is an existing duplicate violation for the given transactionID and has been dismissed:

    • Listen to the transactionViolations_* Onyx key. Remember the key looks like this:
      image

    • Check if the duplicatedTransaction key is set in the above Onyx key for the transaction and return true only if the following condition is not met:

      • Since the violation could have been dismissed, check if the corresponding transactions_* key contains an entry for the current user:
        image-2024-04-08 10_51_27 803
  • Add a new condition to ReportUtils.isOnHold to see if the transaction is a duplicate by calling TransactionUtils.isDuplicate(transactionID, true).

  • In components/ReportActionItem/MoneyRequestView.js in the View for the HOLD banner:

    • Check if the transaction has any duplicates by checking the corresponding Onyx key transactionViolations_*. If so, replace the props.translate('iou.requestOnHold') for props.translate('iou.requestDuplicate') that contains the message defined in the screenshot at the beginning of the issue (asked me for the Spanish translations).

    • If there are duplicates, add a new <Button> to review duplicates. Don't navigate anywhere for now but eventually it will do the following:

      • Navigate the user to the route for a new page ReviewDuplicate

      • Pass the threadReportID of the transaction in the route to the new page.

Manual Test Steps

image

image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016dc734e5d5fc1a3f
  • Upwork Job ID: 1778425579213647872
  • Last Price Increase: 2024-04-11
  • Automatic offers:
    • akinwale | Reviewer | 0
    • gijoe0295 | Contributor | 0
Issue OwnerCurrent Issue Owner: @MitchExpensify

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething 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