Skip to content
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

Include both original and revised government responses in the json feed #782

Open
johnhzhu opened this issue Mar 24, 2021 · 5 comments
Open

Comments

@johnhzhu
Copy link

When there is a revised government response, return the original government response in the Json feed. Currently only the revised government response is in the Json feed.

@pixeltrix
Copy link
Contributor

As we discussed in our meeting the original response is stored as an 'Other parliamentary business' item which corresponds to a Petition::Email within the application. Previously these weren't made available in the JSON feed but as of today they are under the key path data.attributes.other_parliamentary_business which returns an array of objects with the keys subject, body, created_at and updated_at. An example can be found on petition 302576 and a screenshot of the output is below:

image

@johnhzhu
Copy link
Author

johnhzhu commented Apr 19, 2021

Thanks. That is quite helpful. Could the actual date of the original government response be reflected in the created_at field or a new field such as responded_on in the json data? For the example you gave, it is stated that original response was published on 7 July 2020 in the body text, but the json field created_at has value 2020-09-15. If the published dates are included, we can easily put multiple government responses in a timeline order.

@pixeltrix
Copy link
Contributor

There's a government_response_at field which is the timestamp of that first government response being created. The responded_on property of the government_response object is the date of the latest government response and then the created_at of the other business object is the timestamp that the new government response was added. This isn't ideal but should allow you to reconstruct the timeline.

@johnhzhu
Copy link
Author

Thanks for your quick reply. For the example: government_response_at contains 2020-07-08, but in the body text says 7 July 2020. Seems inconsistent. Will there be a chance that there are two or more revised government responses? If that happens, harder to reconstruct the timeline?

@pixeltrix
Copy link
Contributor

pixeltrix commented Apr 19, 2021

For the example: government_response_at contains 2020-07-08, but in the body text says 7 July 2020. Seems inconsistent.

The government_response_at is an auto generated timestamp so the fact that it's recorded as the next day seems consistent with the official response date of 7 July 2020.

Will there be a chance that there are two or more revised government responses?

Possibly, yes - however a search of the data suggests only 11 amended responses in nearly 6 years and never twice for the same petition.

I agree that all this is not ideal - there is a backlog item to make amended government responses a thing within the application. However that would require spending of maintenance budget to implement - I'm happy to do so if you want to have a chat with Ben Sneddon or Ed Faulkner on the Petitions team.

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

No branches or pull requests

2 participants