-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fraud check #3331
Add fraud check #3331
Conversation
31fbf38
to
a2e1ee0
Compare
a2e1ee0
to
fa57085
Compare
fa57085
to
7fb712a
Compare
7fb712a
to
953d6e5
Compare
c13d4e3
to
c006d04
Compare
c006d04
to
8de2fda
Compare
return false unless valid? | ||
|
||
ApplicationRecord.transaction do | ||
RiskIndicator.where.not(id: records.map(&:id)).destroy_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it have been easier to delete everything then just re-add the whatevers in the CSV?
not sure if this methodology has any benefits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a bit easier, just seemed weird to create new records when the data hasn't changed!
8de2fda
to
7bdfa3a
Compare
7bdfa3a
to
8d9c0ab
Compare
476b4ff
to
15a1c37
Compare
<%= govuk_link_to( | ||
"Download CSV", | ||
admin_fraud_risk_csv_download_path(format: :csv), | ||
class: "govuk-button" | ||
) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a mechanisim for admins to upload a csv of known risky trns and ninos that will cause claims with these attributes to be flagged in the admin ui. Flagged values can be removed by uploading a CSV without those values. We've added some new functionality to the task/index notification banner. The banner now supports rendering multiple messages. If there is a single banner notification is falls back to the original view and renders a p tag, with multiple notifications it now renders a list.
When the fraud risk csv is uploaded add notes to any claims with matching details.
15a1c37
to
5939d35
Compare
Add fraud check
Adds a mechanisim for admins to upload a csv of known risky trns and
ninos that will cause claims with these attributes to be flagged in the
admin ui.
Flagged values can be removed by uploading a CSV without those values.
We've added some new functionality to the task/index notification
banner. The banner now supports rendering multiple messages. If there is
a single banner notification is falls back to the original view and
renders a p tag, with multiple notifications it now renders a list.
Notes for review
The main changes in this PR is the introduction of the RiskIndicator model, the new admin controllers for managing the fraud risk CSV, and the changes to the admin/tasks/index banner notification to support rendering multiple messages.
Probably best to start by reviewing the new
app/controllers/admin/fraud_risk_csv_uploads_controller.rb
as that's where the new flow kicks off.Also of note is the new claim verifier
app/models/automated_checks/claim_verifiers/fraud_risk.rb
. This claim verifier doesn't create a task (not a requirement in the ticket but may be wanted in future), however a claim verifier seemed like the natural place to create a fraud risk note on the ticket.Acceptance criteria
When a known TRN submits a claim, the claim is flagged in the main body of the claim. A note needs to be created in the notes section to explain this, similar to the hold/unhold feature.
The claim cannot be approved, these feature is disabled
fraud-prevention-walkthrough.mp4