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 new NoBillingPeriodsError as a reminder #1257

Merged
merged 5 commits into from
Aug 15, 2024
Merged

Conversation

Cruikshanks
Copy link
Member

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

As part of the work to add support for SROC two-part tariff bill runs to the service, we needed to amend the set-up bill run journey. We took this opportunity to rewrite it!

This meant copying some of the existing restrictions, one of which being that you cannot generate a supplementary until the annual has been created and sent.

We then replaced the legacy SROC annual with a new engine, which was much more performant and reliable. Because of this, the billing & data team was able to bring forward the month they generated the bill runs in.

However, they are still blocked from running supplementary until they are ready to generate the annual bill run each year.

So, we were asked to tweak our version, allowing them to generate a supplementary bill run even when the annual has not yet been done.

The old logic for supplementary always took the current financial year as the starting point. The new logic we implemented works by finding the last annual bill run for a region and using its year.

Already run the annual bill? Then, the result would be the current financial year. Not yet run it? Then we'll find last year's and start from there.

That is, however, when working in pre-prod or production where there is a complete history of annual bill runs. Working locally, or perhaps in dev or tst, you may find the last annual was in 2021 or simply doesn't exist at all!

When this happens, the SROC engine is unable to determine the billing periods for the supplementary bill run being requested, and an error is thrown. At the time, coding to handle this situation 'gracefully' was discussed but rejected. We'd be writing code and building screens for a situation that could never happen in production.

The problem is that we forget this every now and again. We then attempt to create a supplementary in one of these non-production environments and start panicking when it appears broken.

This is a 'low-fi' attempt to try and remind us devs why supplementary may appear to be broken. 😁

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

As part of the work to add support for SROC two-part tariff bill runs to the service we needed to amend the set up bill run journey. We took this opportunity to rewrite it!

This meant copying some of the existing restrictions, one of which being that you cannot generate a supplementary until the annual has been created and sent.

We then also replaced the legacy SROC annual with a new engine which was much more performant and reliable. Because of this the billing & data team were able to bring forward the month they generate the bill runs in.

However, that block on running supplementary meant until they are ready to generate the annual bill run each year, meant they are still blocked from being able to generate bills during that period.

So, we were asked to make a tweak to our version, that would allow them to generate a supplementary event when the annual has not yet been done.

The old logic for supplementary always took the current financial year as the start point. The new logic we implemented works by finding the last annual bill run for a region, and using it's year.

Already run the annual bill run? Then the result would be the current financial year. Not yet run it? Then we'll find last years and start from there.

That is however, when working in pre-prod or production where there is a complete history of annual bill runs. Working locally, or perhaps in `dev` or `tst` you may find the last annual was in 2021, or simply doesn't exist at all!

When this happens the SROC engine is unable to determine the billing periods for the supplementary bill run being requested and an error is thrown. At the time coding to handle this situation 'gracefully' was discussed but rejected. We'd be writing code and building screens for a situation that could _never_ happen in production.

The problem is every now and again we forget this. We then attempt to create a supplementary in one of these non-production environments and start panicking when it appears broken.

This is a 'low-fi' attempt to try and remind us devs _why_ supplementary may appear to be broken. 😁
@Cruikshanks Cruikshanks added the enhancement New feature or request label Aug 15, 2024
@Cruikshanks Cruikshanks self-assigned this Aug 15, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review August 15, 2024 09:01
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

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

@Cruikshanks Cruikshanks merged commit 9dff648 into main Aug 15, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-no-annual-error branch August 15, 2024 09:45
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.

4 participants