diff --git a/api/well_inventory.py b/api/well_inventory.py index 4f7769609..1d19ae581 100644 --- a/api/well_inventory.py +++ b/api/well_inventory.py @@ -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}) diff --git a/schemas/well_inventory.py b/schemas/well_inventory.py index aa4079664..e718de96f 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