-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor existing service to create a new one #529
Conversation
https://eaflood.atlassian.net/browse/WATER-4188 As part of the work we have been doing on two-part-tariff. We have found some code that we created for supplementary billing can be re-used for 2PT. This PR will move the code from the `CalculateAuthorisedAndBillableDaysService` that is responsible for determining the abstraction period, and move it to a new service `DetermineAbstractionPeriodService`. Once extracted out this function can then also be used by the 2PT process as well as supplementary.
SonarCloud failing due to duplicated lines. This is due to the refactoring we are currently doing on 2PT and will not be an issue once complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a second opinion on the comments and a typo. Great stuff!
app/services/bill-runs/determine-abstraction-periods.service.js
Outdated
Show resolved
Hide resolved
app/services/bill-runs/determine-abstraction-periods.service.js
Outdated
Show resolved
Hide resolved
test/services/bill-runs/determine-abstraction-periods.service.test.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://eaflood.atlassian.net/browse/WATER-4188
As part of the work we have been doing on two-part-tariff. We have found some code that we created for supplementary billing can be re-used for 2PT.
This PR will move the code that is responsible for determining the abstraction period from the
CalculateAuthorisedAndBillableDaysService
, and move it to a new serviceDetermineAbstractionPeriodService
.Once extracted out this function can then also be used by the 2PT process as well as supplementary.