Correct general behavior in retrieveLocationLevel #1245
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Location levels could only be retrieved by exact data. Expected behavior was most recent.
during #1086 the "exact" match flag was changed from true to false. Change is behavior was not correctly caught due to all tests using the exact dates and the endpoint itself not providing appropriate description.
Description has been updated.
The virtual location level tests were modified to specify exact date. In diagnosing the issue I've discovered that the order of these operations is wrong:
https://github.com/HydrologicEngineeringCenter/cwms-database/blob/f2670f46de2f41b724ac9d516505fa9a37c50cfa/schema/src/cwms/cwms_level_pkg_body.sql#L612
Virtual location levels should still support "or nearest before behavior" but at the least with match being false while providing the exact date should return the level and it does not.
I've set the default behavior of exact match to False, knowing this will break existing virtual location level behavior, however, that will be corrected with a database proceedure fix.
... well, or we could just rewrite that whole sequence of events in CDA but that doesn't seem necessary at this time.