BDMS 414: updates to the contact response for searches#280
Merged
Conversation
Adding the id field will enable the frontend to allow users to click on a searched contact and go to the contact detail page
This information is now housed in the WellPurpose model, which has a 1:M relationship with Thing. When this refactor occurred we never updated the search endpoint to reflect this change.
Adding the contact's id enables the frontend to quickly navigate to its detail view. Including associated things provides context about the contact's relationships, enhancing the search experience. Since the ID is also included the frontend can use it to go to the thing's detail page.
Codecov Report✅ All modified and coverable lines are covered by tests.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
TylerAdamMartinez
approved these changes
Dec 9, 2025
TylerAdamMartinez
left a comment
Contributor
There was a problem hiding this comment.
It's perfect 😍
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:
idto allow the user to click on the contact and navigate immediately to the contact's detail pageHow
Implementation summary - the following was changed / added / removed:
idto itspropertiesfieldpropertiesfield. Because thething_typeis unknown until they have been retrieved the only fields returned in the array of things are:name(in thelabelfield to correspond with how the names are returned elsewhere)idthing_typeNotes
Any special considerations, workarounds, or follow-up work to note?
thingmodel was refactored a while ago to allow multiple well purposes we forgot to update the/searchendpoint. To fix this I removedwell_purposefrom the search'swell_responseand now return a field calledwell_purposesthat evaluates to a list of purposes (i.e. a list of one or more strings)"well_purposes": ["Domestic", "Irrigation", "Observation"]or"well_purposes": ["Open, unequipped well"]