Return 400 status response when requesting unrevealed account data
As an API user, I want the API to return a 400 response (“Bad Request”) when I request data from a period that has a submission reveal date that is in the future.
Because of how submissions are loaded to USASpending from Broker, we are re-organizing how we are updating the submission_reveal_date. As part of that work we also want to make the response to requesting periods that haven’t been revealed yet to be consistent across the API.
As an API user, I want any API endpoint I use that has a fiscal_period or fiscal_quarter parameter to return an HTTP 400 “Bad Request” response if I request a period/quarter that does not have a submission_reveal_date that has already passed
Unit tests/API contracts updated accordingly
Example endpoint that uses fiscal_period - /api/v2/reporting/agencies/overview/?fiscal_year=2021&fiscal_period=12
Create list of API endpoints that take a fiscal period/quarter as a parameter
Check what response those endpoints are currently returning when an invalid/future fiscal period is being selected
Make changes to any endpoints that are not currently returning a `400` response.
Probably want to make a function that will return the last valid fiscal_period/fiscal_quarter
Do we want to return a 400 or a 422 as the response?
Tinyshield could be used for 422, do we want to use tinyshield?
Keith: Probably not a tinyshield situation
Verified on Postman that the API request in QAT returns a 400 response for fiscal year/period that does not have a submission_reveal_date that has already passed. (See screenshot)