-
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
Add 'currentVersion' modifier to LicenceModel #1133
Merged
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-4322 https://eaflood.atlassian.net/browse/WATER-4442 Whilst working on [Fix view licence abs amounts issue plus refactor](#1132) we started making a change to `app/services/licences/fetch-licence-summary.service.js` to bring how it fetches the current licence to be inline with `app/services/return-requirements/setup/fetch-abstraction-data.service.js`. In both cases, the services that call these are then doing `licence.licenceVersions[0]` in order to access the 'current' one. We could ensure consistency by adding an [Objection.js modifier](https://vincit.github.io/objection.js/api/model/static-properties.html#static-modifiers) to `LicenceModel`. And then we could make it explicit we only care about the current licence (and make everyone's lives easier) if we added a custom [instance method](https://vincit.github.io/objection.js/api/model/instance-methods.html)! This change does both then updates anything currently handling a current licence version to use them.
Cruikshanks
added
the
housekeeping
Refactoring, tidying up or other work which supports the project
label
Jun 21, 2024
This would be better done in the service that calls fetch
We also remove some. But we didn't really need to include them as whether a licence has a licence holder or not is something that is fetched by the Fetch service and determined in the presenter. Those are better placed to do the testing.
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-4322
https://eaflood.atlassian.net/browse/WATER-4442
Whilst working on Fix view licence abs amounts issue plus refactor we started making a change to
app/services/licences/fetch-licence-summary.service.js
to bring how it fetches the current licence to be in line withapp/services/return-requirements/setup/fetch-abstraction-data.service.js
.In both cases, the services that call these are then doing
licence.licenceVersions[0]
in order to access the 'current' one. We could ensure consistency by adding an Objection.js modifier toLicenceModel
. And then we could make it explicit that we only care about the current licence (and make everyone's lives easier) if we added a custom instance method!This change does both then updates anything currently handling a current licence version to use them.