App: [$500][Dupe Detection] Surfacing Potential Duplicates
Part of the <Project Name> project
Main issue: https://github.com/Expensify/Expensify/issues/307591 Doc section: Surfacing Potential Duplicates Project: [Wave: Collect Approvers] Dupe Detection
UI
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:
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:
-
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:
- Since the violation could have been dismissed, check if the corresponding transactions_* key contains an entry for the current user:
-
-
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')
forprops.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
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
About this issue
- Original URL
- State: open
- Created 7 months ago
- Comments: 38 (29 by maintainers)
Admins and the the creator of the expense should be able to review duplicates
Hmm, I need you can remove that part since it’s not supported in the back-end either
I will check what’s going on tomorrow with the violations, I ran out of time today
Done! You should have access now
Because of the above, assigning @gijoe0295, please don’t hesitate to let me know if anything was unclear!
@EzraEllette https://github.com/Expensify/Expensify/issues/307591 is an internal issue and sadly I can’t share the design doc. However, I can answer any questions you might have. I just noticed you are working on a PR already and new contributors are only allowed to be assigned to one issue until it’s merged. After that, you can apply to different open issues, not restricted to one at a time.
@MitchExpensify Ideally external, but I am trying to wrap up the back-end first.