-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update existing return versions when a new one is added #1216
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://eaflood.atlassian.net/browse/WATER-4568 Having worked out how to convert the information in the return requirements setup session into the various records in the DB (see #1137) we now need to deal with how the new record impacts the existing ones. This PR will extend the persisting logic to deal with changes to the existing return versions.
This variable will be used to check if additional processing is required when inserting a new return version
Co-authored-by: Alan Cruikshanks <[email protected]>
Cruikshanks
added a commit
that referenced
this pull request
Aug 8, 2024
https://eaflood.atlassian.net/browse/WATER-4568 A couple of suggested alternative solutions to the one presented in [Update existing return versions when a new one is added](#1216). 1. It avoids the need to first extract _all_ return versions and then identify which previous versions to update 'in code'. The checks are done within the queries sent to the database. In most cases a single query will be fired at the database. But there is a possibility of making 4 calls to the database 2. As currently it extracts _all_ return versions from the database and then identifies which version to update 'in code'. But it breaks the work down rather than doing it all in one large method.
`match` was an instance of `ReturnVersionModel`. So, we don't need to generate another patch query, we can just tell the instance to patch itself!
Cruikshanks
approved these changes
Aug 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://eaflood.atlassian.net/browse/WATER-4568
Having worked out how to convert the information in the return requirements setup session into the various records in the DB (see #1137) we now need to deal with how the new record impacts the existing ones.
This PR will extend the persisting logic to deal with changes to the existing return versions.