Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #3390] Remove agency_phone_number from Opportunity/Search API responses #3392

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you make this a negative assertion rather than just removing the check entirely.

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