-
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 purpose primary and secondary models #1088
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-4442 > Part of the work to replace NALD for handling return requirements We want to be able to offer users the option to generate return requirements from the licence's abstraction data. On the `/setup` page they can select this option and the service is expected to generate return requirements using the source abstraction data against the licence. The other options are copy existing return requirements or set them up manually. When you setup a return requirement you have to specify the frequency (daily, weekly or monthly) meter readings need to be collected and reported. - collected - visit the meter and record the reading - reported - when submitting the readings how they are to be provided Generally they are the same, but there are scenarios where we may ask for readings to be collected more frequently than they are reported. In order to generate the requirements we need to determine what frequencies to use based on the licence's abstraction data. A specific scenario is licences for the purpose of electricity generation; P-ELC-200 and P-ELC-240. - `P` is the 'purpose primary' code - `ELC` is the 'purpose secondary' code - `200` is the 'purpose' legacy ID We record all 3 against a `LicenceVersionPurpose` but currently the only one that exists as a model is 'purpose'. To support this work we also need to know what the primary and secondary purpose on a `LicenceVersionPurposeModel` is. So, this change adds the migrations, helpers and models for `PurposePrimary` and `PurposeSecondary` and sets up the relationships between them and `LicenceVersionPurposeModel`.
This includes adjusting LicenceVersionPurposes view to use the new names for the primary and secondary IDs.
Now we have a primary and secondary helper we can move the generate methods into them and reference them from this helper.
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-4442
We want to be able to offer users the option to generate return requirements from the licence's abstraction data. On the
/setup
page, they can select this option and the service is expected to generate return requirements using the source abstraction data against the licence. The other options are to copy existing return requirements or set them up manually.When you setup a return requirement you have to specify the frequency (daily, weekly or monthly) meter readings need to be collected and reported.
Generally they are the same, but there are scenarios where we may ask for readings to be collected more frequently than they are reported.
In order to generate the requirements automatically, we need to determine what frequencies to use based on the licence's abstraction data. A specific scenario is licences for the purpose of electricity generation; P-ELC-200 and P-ELC-240.
P
is the 'purpose primary' codeELC
is the 'purpose secondary' code200
is the 'purpose' legacy IDWe record all 3 against a
LicenceVersionPurpose
but currently the only one that exists as a model is 'purpose'. To support this work, we also need to know what the primary and secondary purposes on aLicenceVersionPurposeModel
are.So, this change adds the migrations, helpers and models for
PurposePrimary
andPurposeSecondary
and sets up the relationships between them andLicenceVersionPurposeModel
.It then adds a modifier to
LicenceVersionPurpose
to automate fetching them, along with a custom model instance method that can be used to determine if aLicenceVersionPurposeModel
is for the purpose of electricity generation.