-
Notifications
You must be signed in to change notification settings - Fork 0
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
[96] CSV upload #56
[96] CSV upload #56
Conversation
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.
Looking good!
@@ -0,0 +1,7 @@ | |||
|
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.
extra line
validates :last_name, | ||
presence: true, | ||
uniqueness: { | ||
scope: %i[first_names date_of_birth] |
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.
This made me think - if there were two records with same last_name
, first_names
and date_of_birth
, but one of them also had a trn
/ national_insurance_number
, we might want to keep the one with more info / compare the two.
If that ever happened we should probably handle that manually though, rather than in code.
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.
Ah yes, if the first record to make it to the db is missing the TRN we'd never update it. I will make sure we update existing matches.
@@ -0,0 +1,8 @@ | |||
,SIMPSON,HOMER DUFF,19/01/1980 00:00,,N | |||
,MOUSE,MICKEY,05/02/1980 00:00,,N | |||
,MUFFET,LITTLE MISS,06/02/2000 00:00,,N |
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.
Sorry, I'm using your PR to think out loud 😂 - if the CSV ever had Mr/Miss etc in it, we might need to think about how we match on records. The risk is we return "No record found" when there is a matching record.
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.
Yeah that's a good point, I think we should strip the names of any titles, I was thinking that we need to standardise the case for the values so I'll add to this.
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.
@steventux nice! could defs be in a follow-up PR if you wanted.
63242bc
to
6f7c49f
Compare
96ff15b
to
5003eb1
Compare
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.
🚀
I'm still not 100% sure about how much we should format the names when we save them vs how much we format people's incoming searches for comparison, but i think we just need to test it out with various scenarios and make sure we're returning the best results.
@AbigailMcP I see what you mean, presumably searching in a consistent case would be simpler? |
Adds an UploadForm which expects some form of IO instance which can be read by the service as CSV data. The service class creates a ChildrensBarredListEntry for each new row of CSV data.
Adds a very basic CSV upload form and system spec.
Context
We receive a CSV file from the Disclosure and Barring Service (weekly).
This CSV file contains details of any new additions to the barred list.
We need to store these additions within the service.
Changes proposed in this pull request
ChildrensBarredListEntry
records.Support form for CSV uploads
Form validation
(CSV parse error)
Success
Guidance to review
Not in scope
Link to Trello card
https://trello.com/c/MSBcR45T/96-csv-upload
Checklist