Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix miscalculated preview 2PT charge in review pt2
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.
- Loading branch information