Skip to content

Add funder query param for opportunities#2428

Open
hminsky2002 wants to merge 2 commits into
mainfrom
2372-add-endpoint-to-query-related-opportunities-for-a-funder
Open

Add funder query param for opportunities#2428
hminsky2002 wants to merge 2 commits into
mainfrom
2372-add-endpoint-to-query-related-opportunities-for-a-funder

Conversation

@hminsky2002
Copy link
Copy Markdown
Contributor

This commit adds in a funder query parameter to the opportunities handler, and corresponding database query, that allows for filtering on funder shortCode.

Closes #2372

@hminsky2002 hminsky2002 requested review from Copilot and slifty May 25, 2026 20:08
@hminsky2002 hminsky2002 removed the request for review from slifty May 25, 2026 20:09
@hminsky2002 hminsky2002 force-pushed the 2372-add-endpoint-to-query-related-opportunities-for-a-funder branch from a101749 to 7431fd3 Compare May 25, 2026 20:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds optional filtering of the existing GET /opportunities endpoint by funder shortCode, implemented end-to-end from request parsing through SQL query execution, with integration tests and changelog documentation.

Changes:

  • Add funder query parameter to GET /opportunities OpenAPI spec and handler parsing.
  • Thread optional funderShortCode into the opportunities bundle loader and SQL query to filter results.
  • Add integration tests for valid filtering and invalid filter validation; document in CHANGELOG.md.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/openapi/paths/opportunities.json Documents new optional funder query parameter for listing opportunities.
src/handlers/opportunitiesHandlers.ts Extracts funder from query string and passes it into the bundle loader.
src/database/queries/opportunities/selectWithPagination.sql Adds optional funder short code filtering to the opportunities query.
src/database/operations/opportunities/loadOpportunityBundle.ts Extends bundle loader to accept optional funderShortCode parameter.
src/tests/opportunities.int.test.ts Adds integration tests for funder filtering and invalid filter handling.
package-lock.json Lockfile metadata updates (adds peer: true flags).
CHANGELOG.md Notes the new optional funder query parameter on GET /opportunities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openapi/paths/opportunities.json
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.56%. Comparing base (5f1c8b1) to head (847d397).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2428   +/-   ##
=======================================
  Coverage   93.56%   93.56%           
=======================================
  Files         303      303           
  Lines        3838     3840    +2     
  Branches      515      517    +2     
=======================================
+ Hits         3591     3593    +2     
  Misses        246      246           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hminsky2002 hminsky2002 force-pushed the 2372-add-endpoint-to-query-related-opportunities-for-a-funder branch 3 times, most recently from 3d06652 to e7a7045 Compare May 25, 2026 20:25
@hminsky2002 hminsky2002 requested review from Copilot and slifty May 25, 2026 20:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread src/handlers/opportunitiesHandlers.ts
@hminsky2002 hminsky2002 force-pushed the 2372-add-endpoint-to-query-related-opportunities-for-a-funder branch from e7a7045 to a10ad3c Compare May 25, 2026 21:37
@hminsky2002 hminsky2002 requested a review from Copilot May 25, 2026 21:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

This commit adds in a funder query parameter to the opportunities
handler, and corresponding database query, that allows for
filtering on funder shortCode.

Issue #2372 Add endpoint to query related opportunities for a funder
@hminsky2002 hminsky2002 force-pushed the 2372-add-endpoint-to-query-related-opportunities-for-a-funder branch from a10ad3c to 847d397 Compare May 25, 2026 21:44
@hminsky2002
Copy link
Copy Markdown
Contributor Author

@slifty addressed the coercion issue, good catch from ze bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add endpoint to query related opportunities for a funder

3 participants