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

Update FetchChargeVersions to use SROC flag #177

Merged
merged 4 commits into from
Mar 29, 2023

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-3948

We have an issue that the current include_in_supplementary_billing flag was added at a time there was only 1 charge scheme. A licence gets flagged irrespective of whether the change relates to PRESROC or SROC.

Where that has impacted us is when sending a billing batch. When it gets sent it clears the flag for all licences included. But if we cancel one, for example, the PRESROC bill run, and send the SROC one we lose which licences still need to be processed on the PRESROC one.

Our solution is to add a new include_in_sroc_supplementary_billing flag to the licences table and only set it to 'true' when an SROC charge version is approved. With this in place our FetchChargeVersionsService needs to be altered to look at that field instead of the old one to identify charge versions to consider for billing.

@Cruikshanks Cruikshanks added the enhancement New feature or request label Mar 27, 2023
@Cruikshanks Cruikshanks self-assigned this Mar 27, 2023
@Cruikshanks Cruikshanks added the do not merge Used for spikes and experiments label Mar 27, 2023
@Cruikshanks
Copy link
Member Author

Cruikshanks commented Mar 27, 2023

DEFRA/water-abstraction-service#2077 and #178 need to be merged before this can be merged.

Cruikshanks added a commit that referenced this pull request Mar 27, 2023
https://eaflood.atlassian.net/browse/WATER-3948

To resolve the issue of dealing with PRESROC and SROC licences flagged for supplementary billing, and how we remove those flags when bill runs get 'sent' we've [made a change to the `FetchChargeVersionsService`](#177) to look at a [new field we've added](DEFRA/water-abstraction-service#2077) to the `water.licences` table.

This broke some tests, a number of which were in the `FetchLicencesService`. We were about to embark on fixing them when we remembered that with the direction our work on supplementary billing took `FetchLicencesService` had become redundant.

So, rather than spend time fixing them we're just getting on and removing the service.
Cruikshanks added a commit that referenced this pull request Mar 28, 2023
https://eaflood.atlassian.net/browse/WATER-3948

To resolve the issue of dealing with PRESROC and SROC licences flagged for supplementary billing, and how we remove those flags when bill runs get 'sent' we've [made a change to the `FetchChargeVersionsService`](#177) to look at a [new field we've added](DEFRA/water-abstraction-service#2077) to the `water.licences` table.

This broke some tests, a number of which were in the `FetchLicencesService`. We were about to embark on fixing them when we remembered that with the direction our work on supplementary billing took `FetchLicencesService` had become redundant.

So, rather than spend time fixing them we're just getting on and removing the service.
https://eaflood.atlassian.net/browse/WATER-3948

We have an issue that the current `include_in_supplementary_billing` flag was added at a time there was only 1 charge scheme. A licence gets flagged irrespective of whether the change relates to PRESROC or SROC.

Where that has impacted us is when sending a billing batch. When it gets sent it clears the flag for _all_ licences included. But if we cancel one, for example, the PRESROC bill run, and send the SROC one we lose which licences still need to be processed on the PRESROC one.

[Our solution](DEFRA/water-abstraction-service#2077) is to add a new `include_in_sroc_supplementary_billing` flag to the `licences` table and only set it to 'true' when an SROC charge version is approved. With this in place our `FetchChargeVersionsService` needs to be altered to look at that field instead of the old one to identify charge versions to consider for billing.
We need the new column in our test db.
@Cruikshanks Cruikshanks force-pushed the fetch-only-include-in-sroc-supp-licences branch from 0aee246 to cd99d9e Compare March 28, 2023 12:48
@Cruikshanks Cruikshanks removed the do not merge Used for spikes and experiments label Mar 28, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review March 28, 2023 13:01
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cruikshanks Cruikshanks merged commit dc233c5 into main Mar 29, 2023
@Cruikshanks Cruikshanks deleted the fetch-only-include-in-sroc-supp-licences branch March 29, 2023 10:24
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