Skip to content

Commit

Permalink
[Issue #3390] Remove agency_phone_number from Opportunity/Search API …
Browse files Browse the repository at this point in the history
…responses (#3392)

## Summary
Fixes #3390 

### Time to review: 10 mins

## Changes proposed
Remove `agency_phone_number` from opportunity GET and search API
responses.

## Context for reviewers
Additional context in #3390 and associated ticket.

## Additional information
See updated unit tests.

---------

Co-authored-by: nava-platform-bot <platform-admins@navapbc.com>
  • Loading branch information
mikehgrantsgov and nava-platform-bot authored Jan 6, 2025
1 parent 1afd3d4 commit e2302f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
6 changes: 0 additions & 6 deletions api/openapi.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1496,12 +1496,6 @@ components:
description: Additional information about the types of applicants that are
eligible
example: All types of domestic applicants are eligible to apply
agency_phone_number:
type:
- string
- 'null'
description: The phone number of the agency who owns the opportunity
example: 123-456-7890
agency_contact_description:
type:
- string
Expand Down
8 changes: 0 additions & 8 deletions api/src/api/opportunities_v1/opportunity_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,6 @@ class OpportunitySummaryV1Schema(Schema):
"example": "All types of domestic applicants are eligible to apply",
},
)

agency_phone_number = fields.String(
allow_none=True,
metadata={
"description": "The phone number of the agency who owns the opportunity",
"example": "123-456-7890",
},
)
agency_contact_description = fields.String(
allow_none=True,
metadata={
Expand Down
2 changes: 1 addition & 1 deletion api/tests/src/api/opportunities_v1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def validate_opportunity_summary(db_summary: OpportunitySummary, resp_summary: d
== resp_summary["applicant_eligibility_description"]
)

assert db_summary.agency_phone_number == resp_summary["agency_phone_number"]
assert "agency_phone_number" not in resp_summary
assert db_summary.agency_contact_description == resp_summary["agency_contact_description"]
assert db_summary.agency_email_address == resp_summary["agency_email_address"]
assert (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def validate_search_response(

response_ids = [int(opp["opportunity_id"]) for opp in opportunities]

for opp in opportunities:
if "summary" in opp:
assert "agency_phone_number" not in opp["summary"]

assert (
response_ids == expected_ids
), f"Actual opportunities:\n {'\n'.join([opp['opportunity_title'] for opp in opportunities])}"
Expand Down Expand Up @@ -77,6 +81,7 @@ def build_opp(
award_floor: int | None,
award_ceiling: int | None,
estimated_total_program_funding: int | None,
agency_phone_number: str | None = "123-456-7890",
) -> Opportunity:
opportunity = OpportunityFactory.build(
opportunity_title=opportunity_title,
Expand Down Expand Up @@ -108,6 +113,7 @@ def build_opp(
award_floor=award_floor,
award_ceiling=award_ceiling,
estimated_total_program_funding=estimated_total_program_funding,
agency_phone_number=agency_phone_number,
)

opportunity.current_opportunity_summary = CurrentOpportunitySummaryFactory.build(
Expand Down Expand Up @@ -150,6 +156,7 @@ def build_opp(
award_floor=50_000,
award_ceiling=5_000_000,
estimated_total_program_funding=15_000_000,
agency_phone_number="123-456-7890",
)

NASA_INNOVATIONS = build_opp(
Expand Down

0 comments on commit e2302f0

Please sign in to comment.