Skip to content

Commit

Permalink
Merge pull request #1689 from fedspendingtransparency/feature/dev-193…
Browse files Browse the repository at this point in the history
…5-dev-2049-enhance-endpoint-for-idv-children

DEV-1935/DEV-2049: Enhance endpoint for IDV children
  • Loading branch information
Lizzie Salita authored Feb 21, 2019
2 parents 6613c6c + e1f50ab commit b39ead7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Returns IDVs or contracts related to the requested Indefinite Delivery Vehicle a
"award_type": "DO",
"description": "4524345064!OTHER GROCERY AND R",
"funding_agency": "DEPARTMENT OF DEFENSE (DOD)",
"funding_agency_id": 1219,
"generated_unique_award_id": "CONT_AW_9700_9700_71T0_SPM30008D3155",
"last_date_to_order": null,
"obligated_amount": 4080.71,
Expand All @@ -48,6 +49,7 @@ Returns IDVs or contracts related to the requested Indefinite Delivery Vehicle a
- `award_type`: Type of the award. See https://fedspendingtransparency.github.io/whitepapers/types/ for a better description.
- `description`: Description of the award as provided by the funding agency.
- `funding_agency`: Name of the agency that paid/is paying for the award.
- `funding_agency_id`: Internal surrogate key of the agency.
- `generated_unique_award_id`: Natural key of Award.
- `last_date_to_order`: The date after which no more orders may be placed against the award.
- `obligated_amount`: The amount of money agreed upon for this award.
Expand Down
8 changes: 7 additions & 1 deletion usaspending_api/awards/tests/test_awards_idvs_awards_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ def setUpTestData(cls):
ordering_period_end_date='2018-01-%02d' % transaction_id
)

# We'll need some awards.
# We'll need some awards (and agencies).
for award_id in range(1, AWARD_COUNT + 1):
parent_n = PARENTS.get(award_id)
mommy.make(
'references.Agency',
id=award_id * 12
)
mommy.make(
'awards.Award',
id=award_id,
Expand All @@ -63,6 +67,7 @@ def setUpTestData(cls):
description='description_%s' % award_id,
period_of_performance_current_end_date='2018-03-%02d' % award_id,
period_of_performance_start_date='2018-02-%02d' % award_id,
funding_agency_id=award_id * 12,
)

# We'll need some parent_awards.
Expand Down Expand Up @@ -94,6 +99,7 @@ def _generate_expected_response(previous, next, page, has_previous, has_next, *a
'award_type': 'type_description_%s' % award_id,
'description': 'description_%s' % award_id,
'funding_agency': 'funding_agency_name_%s' % award_id,
'funding_agency_id': award_id * 12,
'generated_unique_award_id': 'GENERATED_UNIQUE_AWARD_ID_%s' % award_id,
'last_date_to_order': '2018-01-%02d' % award_id,
'obligated_amount': float(award_id * (1000 if award_id in IDVS else 1)),
Expand Down
2 changes: 2 additions & 0 deletions usaspending_api/awards/v2/views/idvs/awards.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ac.type_description award_type,
ac.description,
tf.funding_agency_name funding_agency,
ac.funding_agency_id,
ac.generated_unique_award_id,
tf.ordering_period_end_date last_date_to_order,
pac.rollup_total_obligation obligated_amount,
Expand All @@ -60,6 +61,7 @@
ac.type_description award_type,
ac.description,
tf.funding_agency_name funding_agency,
ac.funding_agency_id,
ac.generated_unique_award_id,
tf.ordering_period_end_date last_date_to_order,
ac.total_obligation obligated_amount,
Expand Down

0 comments on commit b39ead7

Please sign in to comment.