Skip to content

Commit

Permalink
Update tests due to supplementary year bump
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4403

In [Bump supplementary end year if no annual bill run](DEFRA/water-abstraction-system#875) we amended our billing engine for supplementary. We made it possible for users to generate supplementary bill runs in years where no annual has yet been created and sent.

Previously, the Billing & Data team would have to put a block on creating bill runs until the annuals were generated. This is because supplementary takes into account previous transactions whereas annual doesn't. Without the change creating a supplementary followed by an annual bill run would result in the customer getting charged twice.

We now determine when the last annual bill run was sent and use its financial end year as the end year for the supplementary bill run. Annual created in this billing period? Then the supplementary will start there and work back 5 years. If the last sent annual was for the previous billing period the supplementary will start _there_ and work back 5 years.

The problem is this means our billing engine is working on the assumption there is _always_ at least one 'sent' annual bill run for a region. This is definitely the case in our live service but not in our test setup.

We've made changes to our [acceptance test fixture setup](DEFRA/water-abstraction-service#2484) to ensure we always create an annual as part of our SROC test fixture. These changes cover any other tweaks needed to get the existing tests working.
  • Loading branch information
Cruikshanks committed Apr 4, 2024
1 parent c985077 commit 0ad9132
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 0ad9132

Please sign in to comment.