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

Update 2PT /check endpoint with latest services #680

Merged
merged 6 commits into from
Jan 25, 2024

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented Jan 22, 2024

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

This follows on from Update 2PT check endpoint with alternate changes where we applied the services we refactored out of our 2PT spike branch to the /check endpoint.

The final set of services has now been refactored and added to main, so we can update the stand-ins service.

We can also update the TwoPartService to use the new way of working, iterating all licences in one place and passing each licence to the new services.


We can drop the PrepareLicences from stand-ins and use the real one. However, when verifying the results we find it useful to see which lines were allocated to which elements. This is not something we care about when generating the review results for real.

The problem is this can only happen deep inside the allocation process. We don't want to add toggles to the production service just for this. We're on the cusp of having the pages ready to go at which point we expect the /check endpoint to become defunct.

So, for now, we just copy the real AllocateReturnsToChargeElementService into our stand-ins and add the tweak which captures which lines were allocated to it.

@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Jan 22, 2024
@Cruikshanks Cruikshanks self-assigned this Jan 22, 2024
https://eaflood.atlassian.net/browse/WATER-4339

This follows on from [Update 2PT check endpoint with alternate changes](#582) where we applied the services we refactored out of our 2PT spike branch to the `/check` endpoint.

The final set of services have now been refactored and added to `main`, so we can complete the work of replacing the stand-ins currently being used.
We can drop the PrepareLicences service and use the real one. However, when verifying the results we find it useful to see which lines were allocated to which elements. This is not something we care about when generating the review results for real.

The problem is these can only happen deep inside the allocation process. We don't want to add toggles to the production service just for this. We're on the cusp of having the pages ready to go at which point we expect the `/check` endpoint to become defunct.

So, for now we just copy the real service into our stand-ins and add the tweak which captures which lines were allocated.
Because the real services don't care about which lines got allocated they don't setup all charge elements to capture this. So, we have to amend the formatter to cater for matched returns without a `lines:` property.
One of the key tweaks was rather than each service iterating all the licences to be checked, one service iterates the licences and calls services that handle each of the steps for a single licence.

So, we needed to update our `/check` endpoint service to do the same.
@Cruikshanks Cruikshanks force-pushed the update-check-endpoint-with-latest branch from 63373c5 to e748d55 Compare January 25, 2024 10:20
@Cruikshanks
Copy link
Member Author

SonarCloud rightly points out that the stand-ins and scenario formatted services could 'be improved'!

But these are temporary modules only there until we have working review pages and the need for the /check endpoint is no more.

I could overrule SonarCloud to get all green. But these issues should continue to be flagged until we remove these modules so I won't.

@Cruikshanks Cruikshanks marked this pull request as ready for review January 25, 2024 11:18
@Cruikshanks Cruikshanks merged commit cd982ea into main Jan 25, 2024
5 of 6 checks passed
@Cruikshanks Cruikshanks deleted the update-check-endpoint-with-latest branch January 25, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant