BDMS-658: add location properties and contact summaries to well responses#632
Open
BDMS-658: add location properties and contact summaries to well responses#632
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional location metadata and contact summaries to the water well API responses, and extends tests/fixtures to validate the new response shape.
Changes:
- Expose
county,state, andquad_nameundercurrent_location.propertiesin GeoJSON responses. - Include a
contactssummary list inWellResponseand eager-load contact associations for well queries. - Add/extend tests and fixtures to cover the new response fields.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
schemas/location.py |
Adds county/state/quad_name to GeoJSON properties and populates them during response shaping. |
schemas/thing.py |
Introduces WellContactSummaryResponse and adds contacts to WellResponse. |
services/thing_helper.py |
Eager-loads Thing.contact_associations -> contact for water well queries to avoid lazy-load issues. |
tests/conftest.py |
Updates the location fixture to include county/state/quad_name. |
tests/test_thing.py |
Adds tests asserting location properties on well-by-id and contact summaries on the well list endpoint. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem / context:
Location.How
Implementation summary - the following was changed / added / removed:
county,state, andquad_nametoGeoJSONPropertiesand populated them inLocationGeoJSONResponse.populate_fields.contactssummary field toWellResponsewithid,name,organization,contact_type, androle.contact_associations -> contactso the well list response can include contacts efficiently.Notes
Any special considerations, workarounds, or follow-up work to note?
pytest tests/test_thing.py -k "includes_location_properties or includes_contact_summary or details_payload or get_water_well_by_id_404_not_found or get_water_well_by_id_404_wrong_type or get_spring_by_id_404_not_found or get_spring_by_id_404_wrong_type"blackpassed on the touched files.flake8on the touched files has an existing baseline ofE501andF403/F405; after removing the one new actionable warning from this change, targeted lint with those baseline rules ignored passed.