From 12148bc27100f18a330fc550193862b5b487cac9 Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Wed, 10 Dec 2025 14:36:10 -0700 Subject: [PATCH 1/2] feat: add historic water level note to well The historic water level doesn't really go into the water level table because it's not a measurement, but it's good ot note. Since it is recorded it's being put into Historic notes for a well --- api/well_inventory.py | 8 ++++++++ schemas/well_inventory.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/well_inventory.py b/api/well_inventory.py index 5f4b072ab..76aa1325c 100644 --- a/api/well_inventory.py +++ b/api/well_inventory.py @@ -478,11 +478,19 @@ def _add_csv_row(session: Session, group: Group, model: WellInventoryRow, user) # -------------------- # add Thing + if model.historic_depth_to_water_ft is not None: + historic_depth_note = ( + f"Historic depth to water: {model.historic_depth_to_water_ft} ft" + ) + else: + historic_depth_note = None + well_notes = [] for note_content, note_type in ( (model.specific_location_of_well, "Access"), (model.special_requests, "General"), (model.well_measuring_notes, "Measuring"), + (historic_depth_note, "Historic"), ): if note_content is not None: well_notes.append({"content": note_content, "note_type": note_type}) diff --git a/schemas/well_inventory.py b/schemas/well_inventory.py index 0524baea6..4cbe29b70 100644 --- a/schemas/well_inventory.py +++ b/schemas/well_inventory.py @@ -222,7 +222,7 @@ class WellInventoryRow(BaseModel): date_drilled: OptionalDateTime = None completion_source: Optional[str] = None total_well_depth_ft: OptionalFloat = None - historic_depth_to_water_ft: OptionalFloat = None # TODO: needs a home + historic_depth_to_water_ft: OptionalFloat = None depth_source: Optional[str] = None well_pump_type: Optional[str] = None well_pump_depth_ft: OptionalFloat = None From bec2a046b365acdf07540cd0466d71014f32ea4d Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Thu, 11 Dec 2025 11:22:54 -0700 Subject: [PATCH 2/2] feat: add historic depth to water source in well notes AMP indicated that the well depth source is the same as the historic depth to water source. --- api/well_inventory.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/api/well_inventory.py b/api/well_inventory.py index 15bb6f7e7..1d19ae581 100644 --- a/api/well_inventory.py +++ b/api/well_inventory.py @@ -487,10 +487,19 @@ def _add_csv_row(session: Session, group: Group, model: WellInventoryRow, user) # -------------------- # add Thing + """ + Developer's note + + Laila said that the depth source is almost always the source for the historic depth to water. + She indicated that it would be acceptable to use the depth source for the historic depth to water source. + """ + if model.depth_source: + historic_depth_to_water_source = model.depth_source.lower() + else: + historic_depth_to_water_source = "unknown" + if model.historic_depth_to_water_ft is not None: - historic_depth_note = ( - f"Historic depth to water: {model.historic_depth_to_water_ft} ft" - ) + historic_depth_note = f"historic depth to water: {model.historic_depth_to_water_ft} ft - source: {historic_depth_to_water_source}." else: historic_depth_note = None