LG-8947 Automatically reject users in fraud review after 30 days#7940
Merged
LG-8947 Automatically reject users in fraud review after 30 days#7940
Conversation
fraud_rejection_daily_job checks for profiles that have been in fraud review for 30 days and then automatically rejects them
changelog: Internal, IdV Fraud, Automatically reject profiles after 30 days fraud review
aduth
reviewed
Mar 7, 2023
app/services/analytics_events.rb
Outdated
| # Tracks when a profile is automatically rejected due to being under review for 30 days | ||
| def automatic_fraud_rejection(verified_at:, **extra) | ||
| track_event( | ||
| 'Automatic Fraud Rejection', |
Contributor
There was a problem hiding this comment.
Could we add a descriptor or namespace to contextualize this to identity proofing, since "fraud" could apply to a lot of different actions in the application. Maybe IdV like we use elsewhere?
Suggested change
| 'Automatic Fraud Rejection', | |
| 'IdV: Automatic Fraud Rejection', |
Similar note could apply to the naming of the FraudRejectionDailyJob class.
zachmargolis
reviewed
Mar 7, 2023
Comment on lines
+14
to
+17
| Profile.where( | ||
| fraud_review_pending: true, | ||
| verified_at: ..30.days.ago, | ||
| ) |
Contributor
There was a problem hiding this comment.
we don't have an index on verified_at , can we add one? otherwise this will be a table scan
Contributor
There was a problem hiding this comment.
or on fraud_review_pending just something so that we don't scan the whole table
Contributor
Author
There was a problem hiding this comment.
Ok I'll place it on fraud_review_pending we are looking to replace the boolean with a timestamp further down the line.
Merged
zachmargolis
pushed a commit
that referenced
this pull request
Mar 14, 2023
* create fraud rejection daily job fraud_rejection_daily_job checks for profiles that have been in fraud review for 30 days and then automatically rejects them * add test for fraud rejection job * added fraud job to cron job * added ability to notify user * add changelog changelog: Internal, IdV Fraud, Automatically reject profiles after 30 days fraud review * fix typo in notify * add Fraud infront of analytics event * add index to fraud_review_pending
Merged
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.
🎫 Ticket
LG-8947
🛠 Summary of changes
Added a cron job that automatically rejects profiles that are in fraud review for 30 days or more. Users should not be notified if they get an automated rejection.