-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use
ChargingModuleRequestLib
(#130)
https://eaflood.atlassian.net/browse/WATER-3903 We [previously](#129) introduced `ChargingModuleRequestLib` to handle requests to the Charging Module -- obtaining a Cognito token, formatting the response, etc. This PR updates our existing code to use it. While doing this we realise that we need to make changes to `ChargingModuleRequestLib` to ensure it plays nicely with calling services. We therefore no longer manipulate the response -- for example, we previously overwrite it with the contents of the response body, meaning we lost things like http headers, status code etc. We now leave the body where it is. We also amend how `ChargingModuleCreateBillRunService` returns the created bill run to again remove manipulation of the response. The CM returns bill run data in a `billRun` object within its response; we previously moved the contents out so they weren't nested within this object but we now leave the `billRun` object alone. This means we don't need to make special allowances for things like error responses (ie. "if the response has no body then it is a network error so don't manipulate it, otherwise if it has a body and a bill run then it is a valid response so manipulate it, otherwise if it has a body but no bill run then it is an http error so don't manipulate it").
- Loading branch information
Showing
6 changed files
with
59 additions
and
103 deletions.
There are no files selected for viewing
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
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
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
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
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
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