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 duplicate purposes in return reqs. set up #1180

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

Cruikshanks
Copy link
Member

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

Part of the return requirements set up work

During the return requirements set up journey, users need to select at least one purpose for each return requirement they are setting up. The purposes they can choose from are only those linked to the current version of the licence.

The issue found is that if a licence is linked to a purpose and then to a point, then the same purpose again but to a different point (perhaps because it has condition or different abstraction properties), it causes our logic to return the same purpose twice. More if things are really complicated!

This change fixes it so that the user only sees a distinct list of applicable purposes on the 'Select the purpose for the requirements for returns' page.

@Cruikshanks Cruikshanks added the bug Something isn't working label Jul 10, 2024
@Cruikshanks Cruikshanks self-assigned this Jul 10, 2024
https://eaflood.atlassian.net/browse/WATER-4592

> Part of the return requirements set up work

During the return requirements set up journey, users need to select at least one purpose for each return requirement they are setting up. The purposes they can choose from are only those linked to the current version of the licence.

The issue found is that if a licence is linked to a purpose and then to a point, then the same purpose again but to a different point (perhaps because it has condition or different abstraction properties), it causes our logic to return the same purpose twice. More if things are really complicated!

This change fixes it so that the user only sees a distinct list of applicable purposes on the 'Select the purpose for the requirements for returns' page.
Better matches how we have named other services.
@Cruikshanks Cruikshanks force-pushed the fix-duplication-in-return-req-purposes branch from 1b19572 to 13aa8c5 Compare July 10, 2024 13:06
Was looking at the wrong purpose ID.
The INNER JOIN was the root cause of the problem. Replacing that with an EXISTS solves it.
@Cruikshanks Cruikshanks marked this pull request as ready for review July 10, 2024 13:46
@Cruikshanks Cruikshanks merged commit 0ed4882 into main Jul 10, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the fix-duplication-in-return-req-purposes branch July 10, 2024 13:46
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