-
Notifications
You must be signed in to change notification settings - Fork 8
[WHIT-1981] Add rake task for MOD covenant pledges finder imports #3330
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
Conversation
6c05cb1
to
ac9726b
Compare
afc_business = ArmedForcesCovenantBusiness.new(**document_data[:attributes].deep_symbolize_keys) | ||
|
||
unless dry_run | ||
afc_business.save |
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.
We did a sleep on the IPO rake task to ensure the order in the csv is preserved, but this one will take forever as it's a much larger csv file, and I think we're ok with the documents being created in a slightly messy order.
|
||
unless dry_run | ||
if dry_run | ||
afc_business.valid? |
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 is a bit superficial on the dry run but it can at least show us any date validations etc.
- this imports data from csv and creates business documents
- add succcesful logs - add error logs - add total error count The document `save` actually registers `:base` errors on the model for 422 errors from publishing-api, which will be handy to count. We will likely get some console logs from the request itself, but a custom log will be easier to read and search for.
- Some capital case corrections - Importing the bespoke pledges as they are rather than trying to do anything extra with the "-"
- Add line to summary - Capital letter corrections to the body template - Changed date preposition so it reads better in the filters - Moved "Other" option to be last
ac9726b
to
50446f3
Compare
- needed to test emails
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.
LGTM
This is part of creating a finder for MOD armed forces covenant pledges, originally here https://www.gov.uk/government/publications/armed-forces-corporate-covenant-signed-pledges.
We're importing the data from a csv via a rake task, from csv file here: https://docs.google.com/spreadsheets/d/1kUmeMRQPhO8qplC4Lbh3DRXdftYczxW5TedjRvWjolQ/edit?gid=1449320752#gid=1449320752
Testing:
Content - to be confirmed with department. Comms in email thread.
See revised import file.
Import screenshots:


JIRA: https://gov-uk.atlassian.net/browse/WHIT-1981