Skip to content

LG-8947 Automatically reject users in fraud review after 30 days#7940

Merged
theabrad merged 12 commits intomainfrom
abrad-lg-8947-30-day-fraudiance
Mar 9, 2023
Merged

LG-8947 Automatically reject users in fraud review after 30 days#7940
theabrad merged 12 commits intomainfrom
abrad-lg-8947-30-day-fraudiance

Conversation

@theabrad
Copy link
Contributor

@theabrad theabrad commented Mar 7, 2023

🎫 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.

theabrad added 5 commits March 1, 2023 14:57
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
@theabrad theabrad requested a review from a team March 7, 2023 15:54
# 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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Fraud: ?

Comment on lines +14 to +17
Profile.where(
fraud_review_pending: true,
verified_at: ..30.days.ago,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have an index on verified_at , can we add one? otherwise this will be a table scan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or on fraud_review_pending just something so that we don't scan the whole table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll place it on fraud_review_pending we are looking to replace the boolean with a timestamp further down the line.

Copy link
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theabrad theabrad merged commit 7b1296a into main Mar 9, 2023
@theabrad theabrad deleted the abrad-lg-8947-30-day-fraudiance branch March 9, 2023 18:49
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants