This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
forked from HHS/simpler-grants-gov
-
Notifications
You must be signed in to change notification settings - Fork 0
[Task]: Add the ability to query the search endpoint by post and close date ranges (search v1) #163
Milestone
Comments
Issue migrated to HHS#2056 |
acouch
pushed a commit
that referenced
this issue
Sep 18, 2024
…nt schema (navapbc/simpler-grants-govnavapbc/simpler-grants-gov#168) Fixes HHS#2056 - Added .with_start_date to search_schema builder to allow building a date field with key of "start_date" - Added .with_end_date to search_schema builder to allow building a date field with key of "end_date" - Added post_date and close_date properties to OpportunitySearchFilterV1Schema class, which utilize the above to build schema filters for post_date and close_date which can utilize start_date and/or end_date fields. - Added two unit tests in test_opportunity_route_search that will test the data validation of these new filters. One test is for 200 response cases and the other test is for 422 (invalid) response cases. Note: As noted in the AC of Issue #163, this PR does NOT include implementation of the filters. Currently, these filters do nothing as they haven't been tied to any sort of query. This PR is just to lay the ground work. --------- Co-authored-by: nava-platform-bot <platform-admins@navapbc.com>
acouch
pushed a commit
that referenced
this issue
Sep 18, 2024
…nt schema (navapbc/simpler-grants-govnavapbc/simpler-grants-gov#168) Fixes HHS#2056 - Added .with_start_date to search_schema builder to allow building a date field with key of "start_date" - Added .with_end_date to search_schema builder to allow building a date field with key of "end_date" - Added post_date and close_date properties to OpportunitySearchFilterV1Schema class, which utilize the above to build schema filters for post_date and close_date which can utilize start_date and/or end_date fields. - Added two unit tests in test_opportunity_route_search that will test the data validation of these new filters. One test is for 200 response cases and the other test is for 422 (invalid) response cases. Note: As noted in the AC of Issue #163, this PR does NOT include implementation of the filters. Currently, these filters do nothing as they haven't been tied to any sort of query. This PR is just to lay the ground work. --------- Co-authored-by: nava-platform-bot <platform-admins@navapbc.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
NOTE: This ticket won't implement the query to the search index, but is just modifying the API schema, a follow-up PR will be created to fully connect this work.
We want to add the ability to filter specific date fields in our search endpoint.
For context, our search endpoints request looks like:
We want to support a new set of filters for that will look like:
Start and end date will both be optional fields that can be null (we'll treat missing/null as an open-ended range).
To make this change, we'll need to modify our
OpportunitySearchFilterV1Schema
class to have these fields, and configure the allowed fields within the models. Rather than manually define the schemas which would require a lot of additional classes, we can generate the schemas following a similar pattern to how we generate the string search parameters in StrSearchSchemaBuilder, but for dates instead.Acceptance criteria
The text was updated successfully, but these errors were encountered: