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

Create new Charging Module services for reissuing #255

Merged
merged 6 commits into from
Jun 6, 2023

Conversation

StuAA78
Copy link
Contributor

@StuAA78 StuAA78 commented Jun 5, 2023

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

When reissuing, we need to send a PATCH rebill invoice request and a GET invoices request to the CM. This PR creates two new services to implement them:

  • ChargingModuleReissueInvoiceService
  • ChargingModuleViewInvoiceService

Note that "reissuing" is what the business calls it (which is reflected in the frontend) and "rebilling" is what the Charging Module and Water Abstraction Service call it. In the Water Abstraction System we choose to call it "reissuing" in order to align ourselves with the terminology used by the business.

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

When reissuing/rebilling invoices, we need to send a PATCH rebill invoice request and a GET invoices request to the CM. This PR creates new services to implement them.
@StuAA78 StuAA78 added the enhancement New feature or request label Jun 5, 2023
@StuAA78 StuAA78 self-assigned this Jun 5, 2023
@StuAA78 StuAA78 marked this pull request as ready for review June 5, 2023 16:43
StuAA78 added 2 commits June 6, 2023 09:35
The business refers to what we're doing as "reissuing" an invoice. However for historical reasons the Charging Module refers to it as "rebilling". We previously thought it made sense to talk about "rebilling" when dealing with the CM, and "reissuing" everywhere else. However on reflection, we decided that we would prefer to be consistent within our own codebase. We therefore change our terminology to use "reissue" everywhere.
@StuAA78 StuAA78 merged commit 69b89a8 into main Jun 6, 2023
@StuAA78 StuAA78 deleted the create-new-charging-module-services-for-reissuing branch June 6, 2023 15:55
StuAA78 added a commit that referenced this pull request Jul 6, 2023
https://eaflood.atlassian.net/browse/WATER-4036

We have [created the new services we need](#255) to send the appropriate requests to the Charging Module. We now implement invoice reissuing for SROC.

This is done with `ReissueInvoicesService`, which calls `FetchInvoicesToBeReissuedService` to get the invoices for reissuing then passes each one to `ReissueInvoiceService` (note singular `Invoice`) which handles the actual reissuing of the invoice. The resulting invoices, invoice licences and transactions are persisted, and a `true` value returned to indicate that db changes have been made.

The intent is that this service will be called from `ProcessBillingBatchService`, and its return value used to set the `isBatchPopulated` boolean. This PR initially made some changes to `ProcessBillingBatchService` to accommodate this; however due to a merge conflict (and the fact that the changes don't really belong in this PR) the changes in the [`Refactor to accommodate future service`](b251f8a) commit have been reverted. They will be reinstated in the future PR which adds reissuing to the process billing batch process.
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