[Issue #1736] Adjust current opportunity summary logic to want null revision number #1743
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.
Summary
Fixes #1736
Time to review: 3 mins
Changes proposed
Modify the set-current-opportunity script to determine the latest opportunity summary based on the revision number being null (rather than the max value)
Context for reviewers
My understanding of the revision number in the prior implementation was incorrect. We want to determine the latest revision of an opportunity summary based on the revision number, however the latest in the current Oracle system will always be null. The way the current system works is that the revision number is only added once it is moved to the history table. Because we effectively want to ignore all of the historical synopsis/forecast records, we can just check if the value is null.
Due to how the data is structured in the current system where the values are unique in the synopsis & forecast tables for a given opportunity, we know there will only ever be a single forecast / non-forecast that has this value set to null in the data.