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

Fix miscalculated preview 2PT charge in review pt2 #1584

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

Cruikshanks
Copy link
Member

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

In Fix miscalculated preview 2PT charge in review we attempted to resolve an issue where the two-part tariff preview charge feature was incorrectly telling the Charging Module API to include the £141 water company charge in its calculation.

We deduced the issue as logic based on whether a field was populated rather than incorporating whether that value was 'true' or 'false'.

What we didn't clock until testing was that when the value is populated, it is a boolean value. However, our fetch service is casting it to text, which means our fix still equates isSupplyPublicWater = false as 'true' because the value it is testing is 'false' and not false.

This updates the fetch service to cast the value properly, which means the logic we amended in part 1 will now behave as expected.

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

In [Fix miscalculated preview 2PT charge in review](#1583) we attempted to resolve an issue where the two-part tariff preview charge feature was incorrectly telling the [Charging Module API](https://github.com/DEFRA/sroc-charging-module-api) to include the £141 water company charge in its calculation.

We deduced the issue as being logic based on whether a field was populated, rather than also incorporating whether that value was 'true' or 'false'.

What we didn't clock until testing was that when the value is populated, it is as a boolean value. However, out fetch service is casting it to text, which means our fix is still equating `isSupplyPublicWater = false` as 'true', because the value it is testing is `'false'` and not `false`.

This updates the fetch service to cast the value properly, which then means the logic we amended in part 1 will now behave as expected.
@Cruikshanks Cruikshanks added the bug Something isn't working label Dec 23, 2024
@Cruikshanks Cruikshanks self-assigned this Dec 23, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review December 23, 2024 15:25
@Cruikshanks Cruikshanks merged commit 5fb2330 into main Dec 23, 2024
7 checks passed
@Cruikshanks Cruikshanks deleted the fix-miscalculated-preview-charge-part-2 branch December 23, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant