[DEV-14890] - New Download/v2/search endpoint#4627
[DEV-14890] - New Download/v2/search endpoint#4627DavidMikolaKC wants to merge 24 commits intoqatfrom
Conversation
…pending-api into ftr/dev-14890-new-download-search-endpoint
zachflanders-frb
left a comment
There was a problem hiding this comment.
This is looking good to me. I just have one comment about finishing up the api docs by linking to where this filter object is already defined in our docs.
sethstoudenmier
left a comment
There was a problem hiding this comment.
Looks good! My comments are all related to some cleanup.
| + `tsv` | ||
| + `pstxt` | ||
| + `limit` (optional, number) | ||
| + `spending_level` (optional, enum[string]) |
There was a problem hiding this comment.
| + `spending_level` (optional, enum[string]) | |
| + `spending_level` (optional, array[enum[string]]) |
I believe this will pass Dredd tests for the API blueprint. This spending_level filter is slightly different from other examples because it allows multiple selections instead of a single choice.
| + `subawards` | ||
| + `transactions` | ||
| + `awards` | ||
| + Default: `transactions` |
There was a problem hiding this comment.
| + Default: `transactions` | |
| + Default: `["transactions"]` |
Not sure about this syntax, but this is also different because it is an array of values
There was a problem hiding this comment.
This default value is not accurate to the tinyshield model in the implementation: "default": ["awards", "transactions", "subawards"],
| "columns": [ | ||
|
|
||
| ], | ||
| "download_types": [ | ||
|
|
||
| ], | ||
| "file_format": "csv", | ||
| "filters": { | ||
|
|
||
| }, |
There was a problem hiding this comment.
I would update this to reflect the values in your example request above
| |[/api/v2/download/disaster/recipients/](/api/v2/download/disaster/recipients/)|POST| Returns a zipped file containing Disaster Recipient Funding data | | ||
| |[/api/v2/download/idv/](/api/v2/download/idv/)|POST| Returns a zipped file containing IDV data | | ||
| |[/api/v2/download/status/](/api/v2/download/status/)|GET| gets the current status of a download job that that has been requested with the `v2/download/awards/` or `v2/download/transaction/` endpoint that same day | | ||
| |[/api/v2/download/search/](/api/v2/download/search/)|POST|Generates zip file for download of award data in CSV format, both awards and transactions | |
There was a problem hiding this comment.
Two things here:
- Can you move this above the
/api/v2/download/status/line for alphabetical order? - I would call out in the description that this allows you to download data for Awards, Subawards, and Transactions
|
|
||
| self._json_request["filters"] = final_award_filters | ||
|
|
||
| def _update_custom_award_filters(self, custom_award_filters: dict, filter_all_agencies: bool) -> list: |
There was a problem hiding this comment.
Won't block on this, but since this function specifically updates the filters for the purpose of agencies, I would have that reflected in the name.
| re_path(r"^idv", views.RowLimitedIDVDownloadViewSet.as_view()), | ||
| re_path(r"^status", DownloadStatusViewSet.as_view()), | ||
| re_path(r"^transactions", views.RowLimitedTransactionDownloadViewSet.as_view()), | ||
| re_path(r"^search", views.SearchDownloadViewSet.as_view()) |
There was a problem hiding this comment.
Can you add this above the status endpoint to preserve alphabetical order?
|
|
||
| class SearchDownloadViewSet(BaseDownloadViewSet): | ||
| """ | ||
| This route sends a request to begin generating a zip file that combines award and transaction data |
There was a problem hiding this comment.
| This route sends a request to begin generating a zip file that combines award and transaction data | |
| This route sends a request to begin generating a zip file that combines award, transaction, and subaward data |
Description:
Currently the Advanced Search page allows for users to download either Awards with Subawards or Transactions with Subawards; never combining Awards and Transactions. A new endpoint is needed to support a new download modal that allows users to select which of the three they want. The /api/v2/download/search endpoint will power the downloads on the Advanced Search page and support Awards, Transactions, and Subawards.
Technical Details:
Requirements for PR Merge:
Explain N/A in above checklist: