-
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
Do not create SROC bill run if one already exists #98
Merged
StuAA78
merged 10 commits into
main
from
check-whether-sroc-bill-run-exists-before-creation
Jan 25, 2023
Merged
Do not create SROC bill run if one already exists #98
StuAA78
merged 10 commits into
main
from
check-whether-sroc-bill-run-exists-before-creation
Jan 25, 2023
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-3875 The legacy system will not create a PRESROC bill run if one exists with the same region, financial year and type. There are some exceptions, for example, if the previous bill run has a status of EMPTY or ERROR. The same logic needs to be implemented for SROC supplementary bill runs.
We started this work on an incorrect, outdated branch. When we realised our mistake, we created a new branch and cherry-picked the commits across to it. However we'd overlooked the fact that we recently added the additional status `queued`, which we should also consider to be "live". We therefore update our `LIVE_STATUSES` list to include it
Cruikshanks
reviewed
Jan 25, 2023
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.
It's not critical. More in the 'every penny helps' category. What do you think?
Although `.resultSize()` only gives us the number of rows that a query would return and not the actual data itself, the query still has to be run and the data returned from the db. We therefore select just the `billing_batch_id` to ensure only the minimum required data is returned from the db
Cruikshanks
approved these changes
Jan 25, 2023
Jozzey
approved these changes
Jan 25, 2023
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.
👍🏼
StuAA78
deleted the
check-whether-sroc-bill-run-exists-before-creation
branch
January 25, 2023 17:16
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-3875
The legacy system will not create a presroc bill run if one exists that is "live" (ie. has a status of
processing
,ready
orreview
) with the same region, financial year and type. The same logic needs to be implemented for sroc supplementary bill runs (adding our newqueued
status to the list of statuses we consider to be "live").We do this by creating
CheckLiveBillRunService
, which takes a region id and financial year and returns a boolean to indicate whether there are any "live" bill runs. We then call this fromInitiateBillingBatchService
and throw an error if it returnstrue
. Note that we give the error the same message that thewater-abstraction-service
has but we don't format it as a409
error.