File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -519,6 +519,23 @@ def measuring_point_description(self) -> str | None:
519519 else :
520520 return None
521521
522+ @property
523+ def measuring_point_height_is_assumed (self ) -> bool | None :
524+ """
525+ Returns whether the most recent measuring point height is assumed.
526+
527+ Since measuring_point_history is eagerly loaded, this should not introduce N+1 query issues.
528+ """
529+ if self .thing_type == "water well" :
530+ sorted_measuring_point_history = sorted (
531+ self .measuring_points , key = lambda x : x .start_date , reverse = True
532+ )
533+ if not sorted_measuring_point_history :
534+ return True
535+ return sorted_measuring_point_history [0 ].measuring_point_height_is_assumed
536+ else :
537+ return None
538+
522539 @property
523540 def well_depth_source (self ) -> str | None :
524541 return self ._get_data_provenance_attribute ("well_depth" , "origin_type" )
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ class CreateWell(CreateBaseThing, ValidateWell):
148148 measuring_point_height : float | None = Field (
149149 default = 0 , description = "Measuring point height in feet"
150150 )
151- measuring_point_height_is_assumed : bool = False
152151 measuring_point_description : str | None = None
153152 well_completion_date : PastOrTodayDate | None = None
154153 well_completion_date_source : str | None = None
You can’t perform that action at this time.
0 commit comments