-
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
Removing licence from annual 2pt flags for supp billing #1236
Conversation
https://eaflood.atlassian.net/browse/WATER-4590 When a licence is removed from an annual two-part tariff bill run, it needs to be flagged to be included in the supplementary two-part tariff bill run. This PR is setting the foundation for being able to flag a licence. Currently on the licence table, we have a supplementary bill run flag that is being used for pre sroc supplementary bill runs. However with a 2pt sroc one we need to be able to store the year that the licence needs to be included in. The solution is a new table called licenceSupplementaryYears. This table will contain details of the licenceId, billRunId (if its been picked up by a billRun), the financialYearEnd and if its 2pt. We have the 2pt column to allow us in the future to change existing supplementary flagging for non 2pt bill runs. This PR is specifically looking at when a licence is removed from an annual bill run, that the details then get persisted in our new table. It also looks at the scenario for when a licence is removed from an annual 2pt bill run but then the bill run is cancelled and created again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are just a couple of tweaks I'd suggest in the code. Other than that, this should get things rolling for 2PT supplementary!
app/services/bill-runs/two-part-tariff/submit-remove-bill-run-licence.service.js
Outdated
Show resolved
Hide resolved
app/services/bill-runs/two-part-tariff/submit-remove-bill-run-licence.service.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… view https://eaflood.atlassian.net/browse/WATER-4587 The PR #1236 has changed the way the SROC two-part tariff supplementary billing flag is set. Previously there was a boolean flag in the `licences` table/view to indicate if the licence should be included in the next TPT supplementary bill run. This is no longer sufficient for our needs as we are now required to record the specific year that the TPT supplementary bill run is for. So a new table `licence_supplementary_years` has been built that is now used to record if the licence should go into a supplementary bill run & for which year. As a result the original flag in the `licences` table is no longer required. In this PR the `include_in_sroc_tpt_billing` column is going to be removed from the view. The next PR will be in the `water-abstraction-service` to remove the actual column from the table.
… view (#1242) https://eaflood.atlassian.net/browse/WATER-4587 The PR #1236 has changed how the SROC two-part tariff supplementary billing flag is set. Previously there was a boolean flag in the `licences` table/view to indicate if the licence should be included in the next TPT supplementary bill run. This is no longer sufficient for our needs as we are now required to record the specific year the TPT supplementary bill run is for. So a new table `licence_supplementary_years` has been built that is now used to record if the licence should go into a supplementary bill run & for which year. As a result, the original flag in the `licences` table is no longer required. In this PR the `include_in_sroc_tpt_billing` column will be removed from the view. The next PR will be in the `water-abstraction-service` to remove the actual column from the table. The migrations get upset if I try to remove the column from the legacy migrations at the same time as the view so I'll do another PR.
https://eaflood.atlassian.net/jira/software/c/projects/WATER/boards/96?selectedIssue=WATER-4588 #1236 The new two-part tariff supplementary bill run requires licences to be recorded in our new LicenceSupplementaryYears table, along with the years they affect. The first ticket we picked up for this new process was amending the existing annual two-part tariff review pages. A licence can be removed from the bill run there and this should be flagged. This was added to the existing review pages journey. Since starting work on the other flagging tickets it became clear that the process of adding the licence into our LicenceSupplementaryYears table is going to be repeated if we don't pull this out into its own service. So that is what this PR is for, making a service just for creating the licence record that can be shared amongst the various ways a licence can be flagged.
https://eaflood.atlassian.net/browse/WATER-4588 #1236 The new two-part tariff supplementary bill run requires licences to be recorded in our new LicenceSupplementaryYears table, along with the years they affect. The first ticket we picked up for this new process was amending the existing annual two-part tariff review pages. A licence can be removed from the bill run there and this should be flagged. This was added to the existing review page journey. Since starting work on the other flagging tickets it became clear that the process of adding the licence into our LicenceSupplementaryYears table is going to be repeated if we don't pull this out into its own service. So that is what this PR is for, making a service just for creating the licence record that can be shared amongst the various ways a licence can be flagged.
https://eaflood.atlassian.net/browse/WATER-4590
When a licence is removed from an annual two-part tariff bill run, it must be flagged to be included in the supplementary two-part bill run. This PR sets the foundation for flagging a licence. Currently, on the licence table, we have a supplementary bill run flag used for pre-sroc supplementary bill runs. However, with a 2pt sroc one we need to be able to store the year that the licence needs to be included.
The solution is a new table called licenceSupplementaryYears. This table will contain details of the
licenceId
,billRunId
(if its been picked up by a billRun), thefinancialYearEnd
and if it is 2pt. We have the 2pt column to allow us in the future to change existing supplementary flagging for non-2pt bill runs. This PR is specifically looking at when a licence is removed from an annual bill run, and the details then get persisted in our new table.It also looks at the scenario for when a licence is removed from an annual 2pt bill run but then the bill run is cancelled and created again.