-
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
ProcessBillingBatchService
refactor - pre-generate invoice licences
#218
Merged
StuAA78
merged 10 commits into
main
from
process-billing-batch-pre-generate-invoice-licences
May 15, 2023
Merged
ProcessBillingBatchService
refactor - pre-generate invoice licences
#218
StuAA78
merged 10 commits into
main
from
process-billing-batch-pre-generate-invoice-licences
May 15, 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-3996 In order to fix a bug introduced by our refactoring, we moved to pre-generating all required billing invoices prior to entering the main charge version processing loop. Having done this, we think it would be a good idea to also pre-generate the required invoice licences.
StuAA78
added
the
housekeeping
Refactoring, tidying up or other work which supports the project
label
May 12, 2023
Previously, `GenerateBillingInvoiceLicenceService` would check to see if a new billing invoice licence needed to be created. We no longer need to do this now that we pre-generate all required billing invoice licences. We therefore remove this functionality
We spotted that we were using `billingBatch.billingBatchId` when we were already destructuring this, so we move to using this directly
Renaming functions to make their intent clearer means we can remove comments
StuAA78
force-pushed
the
process-billing-batch-pre-generate-invoice-licences
branch
from
May 15, 2023 10:34
9f788d4
to
3ea897c
Compare
In our `_preGenerateBillingInvoiceLicences` function we were iterating over all charge versions to generate a billing invoice licence for each one, then iterating over the generated billing invoice licences to produce the final keyed object. We realised that we could combine the two steps by iterating over the charge versions and generating the billing invoices in the same step. This means we can also check whether the billing invoice and licence in question already has a billing invoice licence generated, which we weren't doing with the first approach.
After refactoring `_preGenerateBillingInvoiceLicences` to only perform one iteration by combining the mapping and the keying in one go, we do the same for `_preGenerateBillingInvoices`
Cruikshanks
approved these changes
May 15, 2023
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-3996
In order to fix a bug introduced by our refactoring, we moved to pre-generating all required billing invoices prior to entering the main charge version processing loop. Having done this, we think it would be a good idea to also pre-generate the required invoice licences.
This PR also introduces further optimisations to the pre-generation of the billing invoices, reducing the number of times we need to iterate in order to produce the object containing the generated billing invoices.