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

Implement Charging Module Create Bill Run Service #84

Merged
merged 11 commits into from
Jan 11, 2023

Conversation

StuAA78
Copy link
Contributor

@StuAA78 StuAA78 commented Jan 10, 2023

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

We need to be able to send requests to the Charging Module to create new bill runs. This PR implements ChargingModuleCreateBillRunService to do this.

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

We need to be able to send requests to the Charging Module to create new bill runs. This PR implements a service to do this.
@StuAA78 StuAA78 added the enhancement New feature or request label Jan 10, 2023
@StuAA78 StuAA78 self-assigned this Jan 10, 2023
We add the simplest method of authentication which is to call our `ChargeModuleTokenService` every time a request is made then add the returned token to our request headers.

While doing this we realised that we should have been passing the region and rulest in `options.body` and not simply as part of `options`.
We amend the region query to only return `chargeRegionId`, and replace `.where(...whereArgs).first()` with the `.findOne(...whereArgs)` shorthand
We follow the pattern used elsewhere, where we always return a `response` property; this is the bill run data if we were successful, or the error details if we weren't
@StuAA78 StuAA78 marked this pull request as ready for review January 11, 2023 12:30
@StuAA78 StuAA78 merged commit 931a99c into main Jan 11, 2023
@StuAA78 StuAA78 deleted the implement-cm-create-bill-run-service branch January 11, 2023 14:10
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