-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combined functionality to schedule and complete ad-hoc observation into one endpoint #2697
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -719,8 +719,8 @@ class ObservationStore( | |
val (plantingZoneId, plantingSiteId) = | ||
dslContext | ||
.select( | ||
MONITORING_PLOTS.plantingSubzones.PLANTING_ZONE_ID.asNonNullable(), | ||
MONITORING_PLOTS.plantingSubzones.PLANTING_SITE_ID.asNonNullable()) | ||
MONITORING_PLOTS.plantingSubzones.PLANTING_ZONE_ID, | ||
MONITORING_PLOTS.PLANTING_SITE_ID.asNonNullable()) | ||
.from(MONITORING_PLOTS) | ||
.where(MONITORING_PLOTS.ID.eq(monitoringPlotId)) | ||
.fetchOne()!! | ||
|
@@ -1359,7 +1359,7 @@ class ObservationStore( | |
private fun updateSpeciesTotals( | ||
observationId: ObservationId, | ||
plantingSiteId: PlantingSiteId, | ||
plantingZoneId: PlantingZoneId, | ||
plantingZoneId: PlantingZoneId?, | ||
monitoringPlotId: MonitoringPlotId?, | ||
isPermanent: Boolean, | ||
plantCountsBySpecies: Map<RecordedSpeciesKey, Map<RecordedPlantStatus, Int>> | ||
|
@@ -1374,13 +1374,17 @@ class ObservationStore( | |
plantCountsBySpecies, | ||
) | ||
} | ||
updateSpeciesTotalsTable( | ||
OBSERVED_ZONE_SPECIES_TOTALS.PLANTING_ZONE_ID, | ||
observationId, | ||
plantingZoneId, | ||
isPermanent, | ||
plantCountsBySpecies, | ||
) | ||
|
||
if (plantingZoneId != null) { | ||
updateSpeciesTotalsTable( | ||
OBSERVED_ZONE_SPECIES_TOTALS.PLANTING_ZONE_ID, | ||
observationId, | ||
plantingZoneId, | ||
isPermanent, | ||
plantCountsBySpecies, | ||
) | ||
} | ||
|
||
updateSpeciesTotalsTable( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verifying the intent here: we want to update the site-level species totals based on ad-hoc observations? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is mostly due to how observation result store works. Since it relies on a I was thinking that, since ad-hoc plots are always temporary, it will not have permanent data so it should not be so consequential. But perhaps it is easier to write new queries to deal with ad-hoc plots on the result side. |
||
OBSERVED_SITE_SPECIES_TOTALS.PLANTING_SITE_ID, | ||
observationId, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that plot names are going away shortly, so we shouldn't build new client code that expects to be able to pass in a user-supplied name. (But removing this parameter isn't appropriate yet since names still exist for now.)