Skip to content

Commit cef3286

Browse files
committed
[DEV-14890] - Code Reviews for Pull Request
1 parent 8088c80 commit cef3286

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

usaspending_api/api_contracts/contracts/v2/download/search.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,32 @@ This route sends a request to the backend to begin generating a zipfile of award
7777
"file_url": "/csv_downloads/PrimeAwardsTransactionsAndSubawards_2020-01-13_H21M05S48397603.zip",
7878
"download_request": {
7979
"columns": [
80-
80+
"assistance_award_unique_key",
81+
"assistance_transaction_unique_key",
82+
"award_id_fain",
83+
"award_id_uri",
84+
"modification_number",
85+
"sai_number",
86+
"total_funding_amount"
8187
],
8288
"download_types": [
83-
89+
"elasticsearch_awards",
90+
"elasticsearch_transactions",
91+
"elasticsearch_sub_awards"
8492
],
8593
"file_format": "csv",
8694
"filters": {
87-
88-
},
89-
"limit": 0,
90-
"request_type": "search"
95+
"agencies": [
96+
{
97+
"type": "awarding",
98+
"tier": "toptier",
99+
"name": "Department of Agriculture"
100+
}
101+
],
102+
"keywords": ["Defense"]
103+
},
104+
"limit": 0,
105+
"request_type": "search"
91106
}
92107
}
93108

usaspending_api/api_docs/markdown/endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ The currently available endpoints are listed in the following table.
111111
|[/api/v2/download/disaster/](/api/v2/download/disaster/)|POST| Returns a zipped file containing Account and Award data for the Disaster Funding |
112112
|[/api/v2/download/disaster/recipients/](/api/v2/download/disaster/recipients/)|POST| Returns a zipped file containing Disaster Recipient Funding data |
113113
|[/api/v2/download/idv/](/api/v2/download/idv/)|POST| Returns a zipped file containing IDV data |
114-
|[/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 |
115114
|[/api/v2/download/search/](/api/v2/download/search/)|POST|Generates zip file for download of award data in CSV format, both awards and transactions |
115+
|[/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 |
116116
|[/api/v2/download/transactions/](/api/v2/download/transactions/)|POST|Generates zip file for download of award data in CSV format |
117117
|[/api/v2/federal_accounts/<ACCOUNT_CODE\>/](/api/v2/federal_accounts/020-0550/)|GET| Returns a federal account based on its federal account code |
118118
|[/api/v2/federal_accounts/<ACCOUNT_CODE\>/available_object_classes/](/api/v2/federal_accounts/4324/available_object_classes/)|GET| Returns financial spending data by object class based on account's internal ID |

usaspending_api/download/v2/request_validations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ def _handle_custom_award_download(self) -> None:
293293
]
294294

295295
if "agency" in custom_award_filters or "agencies" in custom_award_filters:
296-
final_award_filters["agencies"] = self._update_custom_award_filters(custom_award_filters,
296+
final_award_filters["agencies"] = self._update_custom_award_agencies(custom_award_filters,
297297
filter_all_agencies)
298298

299299
self._json_request["filters"] = final_award_filters
300300

301-
def _update_custom_award_filters(self, custom_award_filters: dict, filter_all_agencies: bool) -> list:
301+
def _update_custom_award_agencies(self, custom_award_filters: dict, filter_all_agencies: bool) -> list:
302302
agency_output = []
303303

304304
if "agency" in custom_award_filters:

usaspending_api/download/v2/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
re_path(r"^disaster", views.DisasterDownloadViewSet.as_view()),
1515
re_path(r"^idv", views.RowLimitedIDVDownloadViewSet.as_view()),
1616
re_path(r"^status", DownloadStatusViewSet.as_view()),
17-
re_path(r"^transactions", views.RowLimitedTransactionDownloadViewSet.as_view()),
18-
re_path(r"^search", views.SearchDownloadViewSet.as_view())
17+
re_path(r"^search", views.SearchDownloadViewSet.as_view()),
18+
re_path(r"^transactions", views.RowLimitedTransactionDownloadViewSet.as_view())
1919
]

usaspending_api/download/v2/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def post(self, request: dict) -> Response:
120120

121121
class SearchDownloadViewSet(BaseDownloadViewSet):
122122
"""
123-
This route sends a request to begin generating a zip file that combines award and transaction data
123+
This route sends a request to begin generating a zip file,
124+
combining award, transaction, and subaward data
124125
"""
125126

126127
endpoint_doc = "usaspending_api/api_contracts/contracts/v2/download/search.md"

0 commit comments

Comments
 (0)