Skip to content
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

Remove two-part tariff supplementary billing flag from the Licences view #1242

Merged
merged 7 commits into from
Aug 8, 2024

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Aug 7, 2024

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.

… 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.
@Jozzey Jozzey added the enhancement New feature or request label Aug 7, 2024
@Jozzey Jozzey self-assigned this Aug 7, 2024
@Jozzey Jozzey marked this pull request as ready for review August 7, 2024 16:30
@Jozzey Jozzey merged commit 14887bb into main Aug 8, 2024
6 checks passed
@Jozzey Jozzey deleted the remove-tpt-supp-flag branch August 8, 2024 08:54
Jozzey added a commit that referenced this pull request Aug 8, 2024
Following on from this PR #1242 where the `include_in_sroc_tpt_billing` column was removed from the view. The intention was to then create migration scripts to remove the column from the table.

However, we have realised that if we do this, given the way the migration scripts run. When all the migrations relating to the removal of this column are pushed up to our servers and they run together. An error will be generated as the migrations will try to remove the column from the table before it is removed from the view.

We have therefore opted for what we do when removing legacy columns from our views. We just comment out the column in the view migration and leave the column in the table.

This PR will update the migration that was created previously.
Jozzey added a commit that referenced this pull request Aug 8, 2024
Following on from this PR #1242 where the `include_in_sroc_tpt_billing` column was removed from the view. The intention was to then create migration scripts to remove the column from the table.

However, we have realised that if we do this, given the way the migration scripts run. When all the migrations relating to the removal of this column are pushed up to our servers and they run together. An error will be generated as the migrations will try to remove the column from the table before it is removed from the view.

We have therefore opted for what we do when removing legacy columns from our views. We just comment out the column in the view migration and leave the column in the table.

This PR will update the migration that was created previously.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants