Skip to content

BDMS 389: Contact note implementation & other fixes#290

Merged
jirhiker merged 7 commits into
well-inventory-csvfrom
contact-note-implementation
Dec 11, 2025
Merged

BDMS 389: Contact note implementation & other fixes#290
jirhiker merged 7 commits into
well-inventory-csvfrom
contact-note-implementation

Conversation

@jacob-a-brown

@jacob-a-brown jacob-a-brown commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • well-inventory-csv.feature requires notes to be added to the Contact model
  • The field note_type should be restricted to values in the lexicon
  • When notes are added via a POST endpoint they need to be refreshed so the code base uses the string values stored in the database for note_type, not NoteType enum members
  • Because of the refactor from Measuring to Sampling Procedure notes the /well-inventory-csv endpoint needed to be updated.
  • sampling_scenario_notes need to be added as a Sampling Procedure note to the inventoried well

How

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

  • Enable notes to be created via services/contact_helper.py::add_contact
  • Add the two contact notes that are specific in the WellInventoryRow schema: result_communication_preference and contact_special_requests_notes
  • Update the CreateNote and NoteResponse schemas to use the NoteType enum to restrict values for the note_type field to what is in the lexicon
  • Rename the import of Measuring notes to Sampling Procedure
  • Add sampling_scenario_notes as a Sampling Procedure note to the inventoried well

Notes

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

  • Updating add_contact and running the unit tests made me realize that the notes need to be refreshed after they are added, otherwise the notes in memory use the NoteType enum members (even though they are stored as strings in the database). By refreshing the notes we ensure that the string values are used, which enables the _get_notes method from the NotesMixin can get notes of a particular note_type for various responses.
  • This PR incorporates the work from the closed PR BDMS 389: add notes to contact #287, as well as some other updates and fixes

the feature well-inventory-csv.feature requires notes to be added to
the contact model. this update enables that to be done for all
contacts. this work is being done in a separate branch so it can be implemented
and inspected on its own
This commit adds support for contact notes in the well inventory import process and API.
If the notes are not refreshed then the notes in the immediate
ThingResponse will use the enum members for `note_type` instead of
the strings stored in the database. By refreshing the notes
the proper string values are loaded and therefore the correct
notes can be compiled for the different notes fields in the response
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

This commit adds sampling_scenario_notes as a Sampling Procedure note to
the well that is being added via the well inventory csv upload
@jirhiker jirhiker merged commit 3013207 into well-inventory-csv Dec 11, 2025
4 checks passed
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.

2 participants