Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions api/well_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,29 @@ 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 - source: {historic_depth_to_water_source}."
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, "Sampling Procedure"),
(model.sampling_scenario_notes, "Sampling Procedure"),
(historic_depth_note, "Historic"),
):
if note_content is not None:
well_notes.append({"content": note_content, "note_type": note_type})
Expand Down
2 changes: 1 addition & 1 deletion schemas/well_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading