-
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
Handle no charge versions in ProcessBillingBatch #174
Merged
Merged
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
Cruikshanks
added
the
housekeeping
Refactoring, tidying up or other work which supports the project
label
Mar 24, 2023
Cruikshanks
force-pushed
the
add-unit-tests-for-process-billing-batch
branch
from
March 30, 2023 08:14
71d8a78
to
c1bb80d
Compare
Cruikshanks
added
bug
Something isn't working
and removed
housekeeping
Refactoring, tidying up or other work which supports the project
labels
Mar 30, 2023
Cruikshanks
changed the title
Add missing unit tests ProcessBillingBatchService
Handle no charge versions in ProcessBillingBatch
Mar 30, 2023
https://eaflood.atlassian.net/browse/WATER-3803 When we create the `ProcessBillingBatchService` we did it as a spike, as we were unsure of what the final service would look like. It's been through some changes since then, especially once we added support for crediting the previous billing batch in. But now we think we have a stable design that we will iterate rather than trash and re-write in future changes. So, as promised, it is time to start adding the missing unit tests.
Whilst thinking of the scenarios to test for ProcessBillingBatchService we though of one not currently tested for the ProcessBillingTransactionsService. What happens if we calculate no billable transactions but the previous billing batch does have transactions for the matching invoice and licence? Our current understanding is that we would credit everything on the previous bill run so our test ensures we get that result.
Again, we are not clear on how it could happen. But just in case we fetch no charge versions to bill we ensure we have protections for it in the service. We also add a unit test to document what we expect the service to do if this happens.
We've had to move around a lot of where things are getting created and stubbed. But now we have our first happy-path unit test that allows the process to complete.
Cruikshanks
force-pushed
the
add-unit-tests-for-process-billing-batch
branch
from
March 30, 2023 11:23
c1bb80d
to
173b859
Compare
Jozzey
approved these changes
Mar 30, 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.
👍🏼
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-3952
https://eaflood.atlassian.net/browse/WATER-3803
To be honest, this change started as our first effort to add unit test coverage for the
ProcessBillingBatchService
. So, for example, our unit test error coverage now covers the changes we made including reversing the previous billing batch.Whilst working on them we realised we were not handling no charge versions being returned at all. So, we put in protection against this issue. Nice!
Only our QA has come across this issue in testing and needs it resolved so they can continue their work.
Hence, we're derailing the original intent of this PR and getting the fix to handle no charge versions returned (plus tests! 😬)