Amend charge versions fetched for SROC supplementary #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-3935
Initial tests of the SROC supplementary bill run process immediately identified charge versions were being included in the bill run that shouldn't be.
The current query is based on WATER-3826, the story that originally defined which charge versions to base the bill run on. It just said
And by inference, the charge version is for the SROC scheme.
The change we have been asked to make is to further filter the charge versions to only those that show as
APPROVED
in the water-abstraction-ui.After some digging we found the
water.charge_versions
table uses a custom data type for thestatus
column. The only permitted values areWe also checked the UI code and found
repos/water-abstraction-ui/src/shared/view/nunjucks/filters/charge-version-badge.js
that handles determining which badge to display based on the charge version status.It looks like there were a lot more statuses at one point. But the TL;DR; is
APPROVED
equates tocurrent
.So, this change updates
FetchChargeVersionsService
to only return charge versions where the status iscurrent
.