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

SRoC Supplementary Billing - Determine Abstraction Period #97

Merged
merged 18 commits into from
Jan 26, 2023

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Jan 24, 2023

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

As part of determining the transactions and Billable Days for Supplementary Billing, the Abstraction Period needs to be taken into account. Abstraction period is the date range in which Licence Holders can abstract water, in terms of Supplementary Billing, then it needs to be taken into account days when the Licence Holder cannot abstract as the dates are outside of the Abstraction Period and therefore not chargeable.

This PR is to determine the correct number of billable days in the abstraction period.

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

As part of determining the transactions and Billable Days for Supplementary Billing, the Abstraction Period needs to be taken into account.  Abstraction period is the date range in which Licence Holders can abstract water, in terms of Supplementary Billing, then it needs to be taken into account days when the Licence Holder cannot abstract as the dates are outside of the Abstraction Period and therefore not chargeable.

This PR is to determine the correct number of billable days in the abstraction period.
@Jozzey Jozzey added the enhancement New feature or request label Jan 24, 2023
@Jozzey Jozzey self-assigned this Jan 24, 2023
@Jozzey Jozzey marked this pull request as ready for review January 24, 2023 15:12
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StuAA78 has raised some good points which are mainly hangovers from by first stab at this service 😳 😬 .

But I also believe there is no point working out billable dates and billable days for an abstraction period that isn't going to be considered.

I've removed the `_flagPeriodsForConsideration` function as it's no longer required. We are now chceking if an abstraction period is valid and not including it in the array at all if it isn't.

New function `_isPeriodValid` created to check if period is valid.
@Jozzey Jozzey requested review from Cruikshanks and StuAA78 January 25, 2023 16:32
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor things. I even did them as suggestions to try and make it quick! 😬

@Jozzey Jozzey requested a review from Cruikshanks January 26, 2023 10:48
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jozzey Jozzey merged commit 8299a82 into main Jan 26, 2023
@Jozzey Jozzey deleted the determine-abstraction-period-billable-days branch January 26, 2023 12:16
Jozzey added a commit that referenced this pull request Feb 6, 2023
https://eaflood.atlassian.net/browse/WATER-3894

Thanks to #97 we now know what the billable days are for each abstraction period (charge_purpose) linked to a charge reference (charge_element && billing_charge_categories) within a charge version.

The final step is to take that information and start generating the transaction line information. For each charge reference in a charge version, there should be one transaction line. So, if a charge reference is linked to multiple abstraction periods, we need the sum of their billable days.
Jozzey added a commit that referenced this pull request Feb 13, 2023
https://eaflood.atlassian.net/browse/WATER-3894

Thanks to #97 we now know what the billable days are for each abstraction period (`charge_purpose`) linked to a charge reference (`charge_element` && `billing_charge_categories`) within a charge version.

The final step is to take that information and start generating the transaction line information. For each charge reference in a charge version, there should be one transaction line. So, if a charge reference is linked to multiple abstraction periods, we need the sum of their billable days.
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.

3 participants