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 Charging Module create transaction service #140

Merged
merged 6 commits into from
Mar 4, 2023

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Mar 3, 2023

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

The transactions we generate in the WRLS service as part of the SROC supplementary bill run need to be added to the Charging Module’s bill run. We already created the bill run using app/services/charging-module/create-bill-run.service.js. So, following that pattern, we add app/services/charging-module/create-transaction.service.js in this change.


Housekeeping

It is a personal preference that has become a convention in our tests. Executing the thing under test should be done within the test rather than a before() block.

It's our opinion when this isn't done you lose sight of what a test is testing as you add more and more unit tests. It does mean you get some duplication. But we think it makes for more readable code.

Because we based on unit tests on those in test/services/charging-module/create-bill-run.service.test.js we spotted this deviation and corrected it as part of this change.

@Jozzey Jozzey added the enhancement New feature or request label Mar 3, 2023
@Jozzey Jozzey self-assigned this Mar 3, 2023
@Jozzey Jozzey marked this pull request as ready for review March 3, 2023 16:48
@Jozzey Jozzey requested a review from Cruikshanks March 3, 2023 16:48
Jozzey added 3 commits March 3, 2023 18:09
…ystem

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

The transactions we generate in the WRLS service as part of the SROC supplementary bill run need to be added to the Charging Module’s bill run. We need to add a service that knows how to communicate with the charging module to send the request and handle the response.
- add the new `CreateTransactionService`
- add unit tests for the service
@Cruikshanks Cruikshanks force-pushed the add-charging-module-create-transaction-service branch from 02e2de4 to e67425a Compare March 3, 2023 18:09
@Cruikshanks Cruikshanks assigned Cruikshanks and unassigned Jozzey Mar 3, 2023
@Cruikshanks Cruikshanks marked this pull request as draft March 3, 2023 18:13
Just to bring it more inline with what we send and what actually gets returned.
It is a personal preference that has become a convention in our tests. Executing the thing under test is done within the test rather than a `before()` block.

IMHO when this isn't done it is easy to lose sight of what a test is testing as you add more and more unit tests. It does mean you get some duplication. But we think it makes for more readable code.
@Cruikshanks Cruikshanks changed the title Add Charging Module create transaction service in water-abstraction-system Add Charging Module create transaction service Mar 4, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review March 4, 2023 10:16
@Cruikshanks Cruikshanks merged commit c46cb74 into main Mar 4, 2023
@Cruikshanks Cruikshanks deleted the add-charging-module-create-transaction-service branch March 4, 2023 10:16
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