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

Add migration to unflag non-SROC licences #2150

Merged
merged 3 commits into from
May 17, 2023
Merged

Conversation

Cruikshanks
Copy link
Member

When we made the change Migration to flag sroc supp. billing invoices we just assumed that all licences by now would have an SROC charge version. In testing, we have found there are licences

  • with only PRESROC charge versions
  • with no charge versions at all!

This means our premise that the flags would be cleared once a bill run has been run is invalid. Some licences will never be cleared! 🤦

So, we're adding this migration to clean up our mess. It will unflag any licence flagged for SROC supplementary that doesn't have at least 1 charge version with a start date >= 2022-04-01.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
When we made the change [Migration to flag sroc supp. billing invoices](#2088) we just assumed that all licences by now would have an SROC charge version. In testing we have found there are licences

- with only PRESROC charge versions
- with no charge versions at all!

This means our premise that the flags would be cleared once a bill run has been ran is invalid. For some licences they will never be cleared! 🤦

So, we're adding this migration to clean up our mess. It will unflag any licence flagged for SROC supplementary that doesn't have at least 1 charge version with a start date >= 2022-04-01.
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label May 16, 2023
@Cruikshanks Cruikshanks self-assigned this May 16, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review May 17, 2023 06:58
@Cruikshanks Cruikshanks merged commit 4e66897 into main May 17, 2023
@Cruikshanks Cruikshanks deleted the unflag-non-sroc-licences branch May 17, 2023 06:59
Cruikshanks added a commit that referenced this pull request May 22, 2023
https://eaflood.atlassian.net/browse/WATER-3995

We added a migration recently to [unflag non-SROC licences](#2150). At the same time we learnt that the [water-import-service](https://github.com/DEFRA/water-abstraction-import) was setting `include_in_supplementary_billing` for any licence where a change in the revoked, lapsed or expired date was noticed. It wasn't checking if the licence has only SROC charge versions, or if it had none.

This causes the same problem our previous migration was fixing; licences get flagged for PRESROC supplementary billing but there is no way to clear it because they'll never be processed when billing runs.

We've [updated the water-abstraction-import](DEFRA/water-abstraction-import#631) to be more intelligent in how it flags licences. This migration will remove the flag from those licences that should never have been flagged in the first place.
Cruikshanks added a commit that referenced this pull request May 22, 2023
https://eaflood.atlassian.net/browse/WATER-3995

We added a migration recently to [unflag non-SROC licences](#2150). At the same time, we learnt that the [water-import-service](https://github.com/DEFRA/water-abstraction-import) was setting `include_in_supplementary_billing` for any licence where a change in the revoked, lapsed or expired date was noticed. It wasn't checking if the licence has only SROC charge versions, or if it had none.

This causes the same problem our previous migration was fixing; licences get flagged for PRESROC supplementary billing but there is no way to clear it because they'll never be processed when billing runs.

We've [updated the water-abstraction-import](DEFRA/water-abstraction-import#631) to be more intelligent in how it flags licences. This migration will remove the flag from those licences that should never have been flagged in the first place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant