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

Check renewal for relevant convictions #193

Merged
merged 13 commits into from
Jun 25, 2018
Merged

Conversation

irisfaraway
Copy link
Member

@irisfaraway irisfaraway commented Jun 21, 2018

https://eaflood.atlassian.net/browse/WC-241

While users have the option to declare convictions themselves, we should also check details against our own conviction records and flag for review as required. The app should check key people and businesses. Any flagged renewals will be reviewed in the back office (implementation for this is a separate story).

If a renewal is flagged, users should be sent to the "renewal received" page, rather than "renewal complete", and the renewal should not be carried out until a member of staff reviews it in the back office.

https://eaflood.atlassian.net/browse/WC-241

While users have the option to declare convictions themselves, we should also check details against our own conviction records and flag for review as required. The app should check key people and businesses. Any flagged renewals will be reviewed in the back office (implementation for this is a separate story).

If a renewal is flagged, users should be sent to the "renewal received" page, rather than "renewal complete", and the renewal should not be carried out until a member of staff reviews it in the back office.
@irisfaraway irisfaraway self-assigned this Jun 21, 2018
Create a new service to send entity matching requests to the Waste Carriers Service API. So far this just formats the correct URLs to send the query. For now, we return the URLs so we have something to test - this is just temporary.

This commit also sets up some extra date formatting, env vars and test factories to prepare for the request.
Use the URLs we've built to send an entity matching request to the waste carriers service API.
Add some more tests to cover various errors we might get when making a request.

Also remove the :not_found response, as this was copied from the address lookup but doesn't apply here.
This is to match the behaviour of the frontend app. If we get an error, we should record that the entity match result is unknown, so it can be flagged and checked again later.
If the result is for the business, it's stored on the transient_registration itself. If it's for a person, it's stored under that person.

We save the result whether it's a positive or negative match. If we run into an error when sending our query to the Java service, we save an "unknown" result.
If a user posts the declaration form and the params are valid, we instantiate and run the EntiyMatchingService.
@irisfaraway irisfaraway requested review from Cruikshanks and removed request for Cruikshanks June 22, 2018 14:49
If a business or a key person gets a positive or unknown match, don't renew that registration immediately, regardless of payment method. Instead, send the user to the "renewal application received" page. A member of staff can then check the matched result and confirm or reject the renewal in the back office.
@irisfaraway irisfaraway merged commit eb4de52 into master Jun 25, 2018
@irisfaraway irisfaraway deleted the feature/conviction-checks branch June 25, 2018 15:46
@irisfaraway irisfaraway added the enhancement New feature or request label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants