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

Add new Charging Module WaitForStatusRequest #829

Merged
merged 2 commits into from
Mar 17, 2024

Conversation

Cruikshanks
Copy link
Member

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

Part of a series of changes to migrate the legacy send a bill run to this project

The Charging Module API generates transaction references for every bill in a bill run and creates the transaction files when it receives a /send request. It will respond with an immediate 204 but the process can take some seconds for the larger bill runs. So, clients should not expect a bill run to have a status of billed or billing_not_required immediately.

Because of this clients need to wait for the status to change from processing. We're already doing this differently in our rebill a bill run code. And, when we finally migrate the refreshing a bill run after the CHA generates it we'll need this again.

So, we're using this opportunity to create a WaitForStatusRequest that should make things easier for ourselves and avoid any duplication in future.

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

> Part of a series of changes to migrate the legacy [send a bill run](https://defra.github.io/sroc-charging-module-api-docs/#/bill-run/SendBillRun) to this project

The [Charging Module API](https://github.com/DEFRA/sroc-charging-module.api) generates transaction references for every bill in a bill run and creating the transaction files when it receives a `/send` request. It will respond with an immediate `204` but the process can take a some seconds for the larger bill runs. So, clients should not expect a bill run to have a status of `billed` or `billing_not_required` immediately.

Because of this clients new to wait for the status to change from `processing`. We're already doing this in a different way in our rebill a bill run code. And, when we finally migrate the refreshing a bill run after the CHA [generates it](https://defra.github.io/sroc-charging-module-api-docs/#/bill-run/GenerateBillRun) we'll need this again.

So, we're using this opportunity to create a `WaitForStatusRequest` that should make the things easier for ourselves and avoid any duplication in future.
@Cruikshanks Cruikshanks added the enhancement New feature or request label Mar 17, 2024
@Cruikshanks Cruikshanks self-assigned this Mar 17, 2024
This will allow us to customise how long we pause between requests. It's more to speed up our unit tests but it also gives us the flexibility to configure the service.
@Cruikshanks Cruikshanks marked this pull request as ready for review March 17, 2024 23:20
@Cruikshanks Cruikshanks merged commit 91312ba into main Mar 17, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-wait-for-status-request branch March 17, 2024 23:20
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.

1 participant