Skip to content

BDMS 233: notes transfer and updates#272

Merged
jirhiker merged 9 commits into
transferfrom
bdms-233-notes-transfer-and-updates
Dec 5, 2025
Merged

BDMS 233: notes transfer and updates#272
jirhiker merged 9 commits into
transferfrom
bdms-233-notes-transfer-and-updates

Conversation

@jacob-a-brown

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • AMP colleagues and well-notes.feature use the nomenclature "General" instead of "Other" to describe general/catch-all notes
  • All thing (wells for now) and location notes should reside in the polymorphic notes table, not in the thing and location tables

How

Implementation summary - the following was changed / added / removed:

  • Renamed Other to General for note types in the lexicon, tests, and models
    • Updated the test "the response should include general well notes (catch all notes field)" in well-notes.py to reflect this change
  • Removed well_construction_notes from the thing model and schemas
    • Added Construction notes to test and transfer scripts
  • Removed notes from the ThingResponse and added general_notes
    • Almost every note type is specific to a particular thing type, and the WellResponse enumerates the notes particular to wells. If we return all notes for every thing there will be duplicate records returned. Since general_notes applies to anything, it is in the base ThingResponse.

Notes

Any special considerations, workarounds, or follow-up work to note?

  • This PR has the feature files in it. Is this because this is the first PR where I (or someone else) ran sh run_bdd.sh and so the feature files are now included? Should they be here? It's kind of a mystery to me...
  • The only LevelStatus that didn't correspond with the lookup table was X? so I added it manually in waterlevl_transfer.py. @TylerAdamMartinez came up with a clever solution in PR [NO TICKET] Update _get_groundwater_level_reason func #271. Should we implement his solution and I remove the if statement I added?
  • This PR replaces PR BDMS 233: transfer updates #261 since it utilizes the new class-based transfer regime. Once I open this PR that one will be closed.

@codex review

this is the nomenclature used by AMP and in the feature files, so
this change improves consistency across the codebase and teams
This field used to be standalone, but with the creation and implementation
of the polymorphic notes table it has been moved there
It used to be called "Other" but has been changed to "General"
The feature file requests specific note types. By returning all notes
at once, duplicate entries will be returned. Furthermore, some note
types only apply to specific thing types. So, general notes are
returned for all thing types, but then for each thing type specific
notes will be returned
these notes are no longer a field in the thing table and need
to be handled separately. they can be added back later on and handled
by the polymorphic notes table, but for
the time being they impede the transfer process
Add relevant notes as enumerated in well-notes.feature and remove
well_construction_notes from the well transfer as they are now
stored in the polymorphic notes table with note_type "Construction"
@codecov-commenter

codecov-commenter commented Dec 4, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
db/thing.py 97.97% <100.00%> (+0.02%) ⬆️
schemas/thing.py 92.52% <100.00%> (-0.07%) ⬇️
tests/conftest.py 86.29% <ø> (ø)
tests/test_transfer_legacy_dates.py 100.00% <100.00%> (ø)
transfers/util.py 22.50% <100.00%> (+0.24%) ⬆️

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread db/thing.py
Comment on lines 371 to +373
@property
def general_notes(self):
return self._get_notes("Other")
return self._get_notes("General")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge General notes exclude existing "Other" entries

The general_notes accessor now only returns notes whose note_type is "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 from general_notes in 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

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.

@jirhiker jirhiker changed the base branch from staging to transfer December 5, 2025 18:06
@jirhiker jirhiker merged commit 047e2fa into transfer Dec 5, 2025
2 of 3 checks passed
@TylerAdamMartinez TylerAdamMartinez deleted the bdms-233-notes-transfer-and-updates branch February 26, 2026 18:29
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.

3 participants