-
Notifications
You must be signed in to change notification settings - Fork 4
BDMS 233: notes transfer and updates #272
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6de7807
refactor: rename 'Other' note type to 'General'
jacob-a-brown a922d13
refactor: move well_construction_notes to polymorphic notes table
jacob-a-brown d1f9cd7
fix: use "General" for general notes in thing model
jacob-a-brown f7087b9
refactor: return specific note types rather than all notes at once
jacob-a-brown efb216b
refactor: update well notes test for general notes
jacob-a-brown 3fc559b
fix: remove well construction notes from CreateWell
jacob-a-brown cd2699f
refactor: transfer well and location notes to polymorphic notes table
jacob-a-brown 821a2e7
feat: add Coordinate as note type to lexicon
jacob-a-brown 35f329e
Merge branch 'transfer' into bdms-233-notes-transfer-and-updates
jirhiker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Created by jakeross at 10/22/25 | ||
| @backend @production | ||
| Feature: Geojson Response | ||
| # Enter feature description here | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and location data in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Request all wells as geojson | ||
| When the user requests all the wells as geojson | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in GEOJSON format | ||
| And the response should be a feature collection | ||
| And the feature collection should have 3 features | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Request all wells in a group as geojson | ||
| When the user requests all the wells for group Collabnet | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in GEOJSON format | ||
| And the response should be a feature collection | ||
| And the feature collection should have 2 features |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Created by jakeross at 10/21/25 | ||
| @backend @BDMS-199 @production | ||
| Feature: Retrieve location notes by well name | ||
| As a user | ||
| I want to retrieve location notes for a given well name | ||
| So that I can view important information about the well's location | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and location data in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve location notes for an existing well | ||
| When the user retrieves the well by ID via path parameter | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include a current location | ||
| And the current location should include notes | ||
| And the notes should be a list of dictionaries | ||
| And each note dictionary should have "content" and "note_type" keys | ||
| And each note in the notes list should be a non-empty string | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve location notes by location ID | ||
| When the user retrieves the location by ID via path parameter | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the location response should include notes | ||
| And the notes should be a list of dictionaries | ||
| And each note dictionary should have "content" and "note_type" keys | ||
| And each note in the notes list should be a non-empty string |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| @backend @BDMS-169 | ||
| Feature: Unified search API returns grouped results | ||
| As a user | ||
| I want to search for contacts, wells, and springs | ||
| So that I can quickly find relevant information across multiple data types | ||
|
|
||
| Background: | ||
| Given a functioning api | ||
| And the system has valid contact, well, and spring records in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve mixed search results | ||
| When the user searches for "<search_term>" | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include results grouped by: | ||
| | Contacts | Wells | Springs | | ||
| And each result should include a label, group, and properties | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve contact results | ||
| When the user searches for "<contact_search_term>" | ||
| Then the system should return a 200 status code | ||
| And the response should include a "Contacts" group | ||
| And each contact result should include: | ||
| #| TODO: use correct field name syntax | | ||
| | id | first_name | last_name | email | phone | address | associated_things | | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve well results | ||
| When the user searches for "<well_search_term>" | ||
| Then the system should return a 200 status code | ||
| And the response should include a "Wells" group | ||
| And each well result should include: | ||
| #| TODO: use correct field name syntax | | ||
| | thing_type | id | name | alternate site name | contact first name | contact last name | contact id | county | | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve spring results | ||
| When the user searches for "<spring_search_term>" | ||
| Then the system should return a 200 status code | ||
| And the response should include a "Springs" group | ||
| And each spring result should include: | ||
| | thing_type | id | |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Created by jakeross at 10/21/25 | ||
| @backend @BDMS-199 | ||
| Feature: Retrieve sensor notes | ||
| As a user | ||
| I want to retrieve sensor notes for a given well name | ||
| So that I can view important information about the well's deployed sensors | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and location data in the database | ||
|
|
||
| # @positive @happy_path | ||
| # Scenario: Request sensor notes for an existing well | ||
| # When the user requests the sensor for well 1 | ||
| # Then the system should return a 200 status code | ||
| # And the system should return a response in JSON format | ||
| # And the response should include notes | ||
| # And the notes should be a non-empty string | ||
|
|
||
| @positive | ||
| Scenario: Request sensor notes by sensor ID | ||
| When the user requests the sensor with ID 1 | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include notes | ||
| And the notes should be a non-empty string | ||
|
|
||
| @negative | ||
| Scenario: Request sensor notes for a non-existing sensor ID | ||
| When the user requests the sensor with ID 9999 | ||
| Then the system should return a 404 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include an error message indicating the sensor was not found | ||
|
|
||
| # @negative @sad_path | ||
| # Scenario: Request sensor notes for a non-existing well | ||
| # When the user requests the sensor for well 9999 | ||
| # Then the system should return a 404 status code | ||
| # And the system should return a response in JSON format | ||
| # And the response should include an error message indicating the well was not found |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Created by jakeross at 11/2/25 | ||
| @backend @BDMS-218 @production | ||
| Feature: Thing query paramaters | ||
| Use query parameters to filter things | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and location data in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Filter things by type | ||
| When the user requests things with type "water well" | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include at least one thing | ||
| And the response should only include things of type "water well" | ||
|
|
||
| @positive @happy_path | ||
| Scenario: | ||
| When the user requests things with type "spring" | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include at least one thing | ||
| And the response should only include things of type "spring" | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Created by jakeross at 11/2/25 | ||
| @backend @BDMS-218 @production | ||
| Feature: Thing type path paramaters | ||
| Use path parameters to filter things | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and location data in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Get all Water Well Things | ||
| When the user requests things with type "water well" | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include at least one thing | ||
| And the response should only include things of type "water well" | ||
|
|
||
| @positive @happy_path | ||
| Scenario: | ||
| When the user requests things with type "spring" | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should include at least one thing | ||
| And the response should only include things of type "spring" | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Created by jakeross at 11/4/25 | ||
| @backend @production | ||
| Feature: Transducer Data Response | ||
| This feature tests the API's ability to retrieve transducer data for wells. | ||
| Background: | ||
| Given a functioning api | ||
| And the system has valid well and transducer data in the database | ||
|
|
||
| @positive @happy_path | ||
| Scenario: Retrieve transducer data for an existing well | ||
| When the user requests transducer data for a well | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
|
|
||
| And the response should be paginated | ||
| And each page should be an array of transducer data | ||
| And each transducer data entry should include a timestamp, value, status | ||
| And the timestamp should be in ISO 8601 format | ||
| And the value should be a numeric type | ||
| And the status should be one of "approved", "not reviewed" | ||
|
|
||
|
|
||
|
|
||
| @negative @sad_path | ||
| Scenario: Retrieve transducer data for a non-existing well | ||
| When the user requests transducer data for a non-existing well | ||
| Then the system should return a 200 status code | ||
| And the system should return a response in JSON format | ||
| And the response should be paginated | ||
| And the items should be an empty list |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
general_notesaccessor now only returns notes whosenote_typeis"General". Existing data and fixtures created before this rename still store general notes as"Other"(e.g., prior transfers and tests), and there is no migration or fallback here, so those notes will silently disappear fromgeneral_notesin API responses after this change. Please either migrate existing note records or have this accessor include both"General"and legacy"Other"note types.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the transfer is run again the database will be wiped and there will be no "Other" notes, so this isn't an issue.