Skip to content

Commit

Permalink
Merge pull request #2088 from fedspendingtransparency/staging
Browse files Browse the repository at this point in the history
Sprint 92 Production Deploy
  • Loading branch information
tony-sappe authored Oct 21, 2019
2 parents 5e6c09e + 99eae4a commit 1fd600e
Show file tree
Hide file tree
Showing 64 changed files with 2,875 additions and 1,687 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ services:
- 8000:8000
command: /bin/sh -c "python -u manage.py runserver 0.0.0.0:8000"
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DB_SOURCE: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DB_R1: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DOWNLOAD_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
ES_HOSTNAME: ${ES_HOSTNAME}

Expand Down
2 changes: 1 addition & 1 deletion usaspending_api/accounts/urls_federal_accounts_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
federal_accounts = views.FederalAccountsViewSet.as_view()

urlpatterns = [
url(r"(?P<pk>[0-9]+)/available_object_classes$", object_class_federal_accounts),
url(r"(?P<pk>[0-9]+)/available_object_classes/?$", object_class_federal_accounts),
url(r"(?P<pk>[0-9]+)/fiscal_year_snapshot/(?P<fy>[0-9]+)/?$", fiscal_year_snapshot_federal_accounts),
url(r"(?P<pk>[0-9]+)/fiscal_year_snapshot/?$", fiscal_year_snapshot_federal_accounts),
# url(r'(?P<pk>[0-9]+)/spending_over_time$', spending_over_time_federal_accounts),
Expand Down
2 changes: 1 addition & 1 deletion usaspending_api/accounts/views/federal_accounts_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ObjectClassFederalAccountsViewSet(APIView):
Returns financial spending data by object class.
"""

endpoint_doc = "usaspending_api/api_docs/api_documentation/federal_account/available_object_classes.md"
endpoint_doc = "usaspending_api/api_contracts/contracts/v2/federal_accounts/available_object_classes.md"

@cache_response()
def get(self, request, pk, format=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FORMAT: 1A
HOST: https://api.usaspending.gov

# Recipient List [/api/v2/award_spending/recipient/{?awarding_agency_id,fiscal_year,limit,page}]

This endpoint lists all all award spending for a given fiscal year and agency id

## GET

This endpoint returns a list of recipients and their amounts.

+ Parameters
+ `awarding_agency_id`: 183 (required, number)
Internal award id of the recipient you are looking for
+ `fiscal_year`: 2017 (required, number)
Fiscal Year
+ `limit`: 10 (optional, number)
The maximum number of results to return in the response.
+ `page`: 1 (optional, number)
The response page to return (the record offset is (`page` - 1) * `limit`).

+ Response 200 (application/json)
+ Attributes
+ `page_metadata` (PageMetadataObject)
+ `results` (array[RecipientListing], fixed-type)

# Data Structures

## PageMetadataObject (object)
+ `count`: 100 (required, number)
+ `page`: 1 (required, number)
+ `has_next_page`: true (required, boolean)
+ `has_previous_page`: false (required, boolean)
+ `next` (required, string, nullable)
+ `current` (required, string, nullable)
+ `previous` (required, string, nullable)

## RecipientListing (object)
+ `award_category`: `contracts` (required, string, nullable)
+ `obligated_amount`: 1000000.01 (required, string)
+ `recipient` (RecipientObject)

## RecipientObject (object)
+ `recipient_id`: 346 (required, number)
+ `recipient_name`: `Company Inc.` (required, string)
21 changes: 21 additions & 0 deletions usaspending_api/api_contracts/contracts/v2/awards/award_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ This endpoint returns a list of data that is associated with the award profile p
+ `place_of_performance` (required, Location, fixed-type)
+ `latest_transaction_contract_data` (required, ContractDetails, fixed-type)
+ `executive_details` (required, Executive, fixed-type)
+ `naics_hierarchy` (required, object)
- `toptier_code` (object)
- `description`: Professional, Scientific, and Technical Services (string)
- `code`: 54 (string)
- `midtier_code` (object)
- `description`: Other Professional, Scientific, and Technical Services (string)
- `code`: 5419 (string)
- `base_code` (object)
- `description`: All Other Professional, Scientific, and Technical Services (string)
- `code`: 541900 (string)
+ `psc_hierarchy` (required, object)
- `toptier_code` (object)
- `description`: SPECIAL STUDIES/ANALYSIS, NOT R&D (string)
- `code`: B (string)
- `midtier_code` (object)
- `description`: SPECIAL STUDIES - NOT R and D (string)
- `code`: B5 (string)
- `base_code` (object)
- `description`: SPECIAL STUDIES/ANALYSIS- ECONOMIC (string)
- `code`: B507 (string)
- `subtier_code` (object)

## IDVResponse (object)
+ `category` (required, enum[string])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
## Available Object Classes
**Route:** `v2/federal_accounts/[federal_account_id]/available_object_classes`
FORMAT: 1A
HOST: https://api.usaspending.gov

**Method:** `GET`
# Available Object Classes [v2/federal_accounts/{federal_account_id}/available_object_classes]

This route returns object classes that the specified federal account has allotted money to.

**Query Parameters Description:**
## GET

* `federal_account_id` - **REQUIRED** - Database id for a federal account.
This route returns object classes that the specified federal account has allotted money to.

### Response (JSON)
+ Parameters
+ `federal_account_id`: 5 (required, number)
Database id for a federal account.

```
{
+ Response 200 (application/json)
+ Attributes (object)
+ `results` (required, array[MajorObjectClass], fixed-type)
+ Body
{
"results": [
{
"id": "10",
Expand Down Expand Up @@ -53,17 +56,17 @@ This route returns object classes that the specified federal account has allotte
"name": "Grants, subsidies, and contributions"
}
]
},....
}
]
}

```
# Data Structures

## MajorObjectClass (object)
+ `id` (required, number)
+ `name` (required, string)
+ `minor_object_class` (required, array[MinorObjectClass], fixed-type)

### Errors
Possible HTTP Status Codes:
* 500 : All other errors
```
{
"detail": "Sample error message"
}
```
## MinorObjectClass (object)
+ `id` (required, number)
+ `name` (required, string)
2 changes: 1 addition & 1 deletion usaspending_api/api_contracts/scripts/mock/drakov.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const drakovOptions = {
sourceFiles: './contracts/**/*.md',
serverPort: 5000,
autoOptions: true,
delay: 2500 // 2.5 seconds
delay: 250 // 0.25 seconds
};


Expand Down

This file was deleted.

31 changes: 30 additions & 1 deletion usaspending_api/api_docs/api_documentation/awards/awards.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,36 @@ If the award has a `category` of `contract`, the response will look like this:
"total_obligation": 18014.04,
"total_subaward_amount": null,
"type": "C",
"type_description": "DELIVERY ORDER"
"type_description": "DELIVERY ORDER",
"naics_hierarchy": {
"toptier_code": {
"description": "Professional, Scientific, and Technical Services",
"code": "54"
},
"midtier_code": {
"description": "Other Professional, Scientific, and Technical Services",
"code": "5419"
},
"base_code": {
"description": "All Other Professional, Scientific, and Technical Services",
"code": "541900"
}
},
"psc_hierarchy": {
"toptier_code": {
"description": "SPECIAL STUDIES/ANALYSIS, NOT R&D",
"code": "B"
},
"midtier_code": {
"description": "SPECIAL STUDIES",
"code": "B5"
},
"base_code": {
"description": "SPECIAL STUDIES/ANALYSIS",
"code": "B507"
},
"subtier_code": {}
}
}
```

Expand Down
Loading

0 comments on commit 1fd600e

Please sign in to comment.