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
2 changes: 1 addition & 1 deletion core/lexicon.json
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@
{"categories": ["note_type"], "term": "Historical", "definition": "Historical information or context about the well or location."},
{"categories": ["note_type"], "term": "General", "definition": "Other types of notes that do not fit into the predefined categories."},
{"categories": ["note_type"], "term": "Water", "definition": "Water bearing zone information and other info from ose reports"},
{"categories": ["note_type"], "term": "Measuring", "definition": "Notes about measuring/visiting the well, on Access form"},
{"categories": ["note_type"], "term": "Sampling Procedure", "definition": "Notes about sampling procedures for all sample types, like water levels and water chemistry"},
{"categories": ["note_type"], "term": "Coordinate", "definition": "Notes about a location's coordinates"},
{"categories": ["well_pump_type"], "term": "Submersible", "definition": "Submersible"},
{"categories": ["well_pump_type"], "term": "Jet", "definition": "Jet Pump"},
Expand Down
4 changes: 2 additions & 2 deletions db/thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def general_notes(self):
return self._get_notes("General")

@property
def measuring_notes(self):
return self._get_notes("Measuring")
def sampling_procedure_notes(self):
return self._get_notes("Sampling Procedure")

@property
def construction_notes(self):
Expand Down
9 changes: 4 additions & 5 deletions schemas/thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class BaseThingResponse(BaseResponseModel):
monitoring_status: str | None
links: list[ThingIdLinkResponse] = Field(default=[], alias="alternate_ids")
monitoring_frequencies: list[MonitoringFrequencyResponse] = []
general_notes: list[NoteResponse] | None = None
general_notes: list[NoteResponse] = []
sampling_procedure_notes: list[NoteResponse] = []

@field_validator("monitoring_frequencies", mode="before")
def remove_records_with_end_date(cls, monitoring_frequencies):
Expand Down Expand Up @@ -243,10 +244,8 @@ class WellResponse(BaseThingResponse):
measuring_point_height_unit: str = "ft"
measuring_point_description: str | None
aquifers: list[dict] = []
water_notes: list[NoteResponse] | None = None
measuring_notes: list[NoteResponse] | None = None

construction_notes: list[NoteResponse] | None = None
water_notes: list[NoteResponse] = []
construction_notes: list[NoteResponse] = []
permissions: list[PermissionHistoryResponse]
formation_completion_code: FormationCode | None

Expand Down
2 changes: 1 addition & 1 deletion tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def add_well(context, session, location, name_num):
for nt, c in (
("General", "well notes"),
("Water", "water notes"),
("Measuring", "measuring notes"),
("Sampling Procedure", "sampling procedure notes"),
("Construction", "construction notes"),
):
n = well.add_note(c, nt)
Expand Down
12 changes: 8 additions & 4 deletions tests/features/steps/well-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ def step_impl(context):


@then(
"the response should include measuring notes (notes about measuring/visiting the well, on Access form)"
"the response should include sampling procedure notes (notes about sampling procedures for all sample types, like water levels and water chemistry)"
)
def step_impl(context):
data = context.response.json()
assert "measuring_notes" in data, "Response does not include measuring notes"
assert data["measuring_notes"] is not None, "Measuring notes is null"
context.notes["measuring"] = data["measuring_notes"]
assert (
"sampling_procedure_notes" in data
), "Response does not include sampling procedure notes"
assert (
data["sampling_procedure_notes"] is not None
), "Sampling Procedure notes is null"
context.notes["sampling_procedure"] = data["sampling_procedure_notes"]


@then(
Expand Down
2 changes: 1 addition & 1 deletion tests/features/well-notes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: Retrieve well notes by well ID
And the response should include location notes (i.e. driving directions and geographic well location notes)
And the response should include construction notes (i.e. pump notes and other construction notes)
And the response should include general well notes (catch all notes field)
And the response should include measuring notes (notes about measuring/visiting the well, on Access form)
And the response should include sampling procedure notes (notes about sampling procedures for all sample types, like water levels and water chemistry)
And the response should include water notes (i.e. water bearing zone information and other info from ose reports)
And the notes should be a non-empty string

Expand Down
Loading