-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3359 from DFE-Digital/LUPEYALPHA-1171/identity-ta…
…sk-1 LUPEYALPHA 1171/identity task
- Loading branch information
Showing
15 changed files
with
623 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
app/models/automated_checks/claim_verifiers/early_years_payments/identity.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
module AutomatedChecks | ||
module ClaimVerifiers | ||
module EarlyYearsPayments | ||
class Identity < AutomatedChecks::ClaimVerifiers::Identity | ||
def perform | ||
return unless claim.eligibility.practitioner_journey_completed? | ||
return unless awaiting_task?(TASK_NAME) | ||
|
||
if one_login_idv_match? | ||
create_task(match: nil, passed: true) | ||
elsif one_login_idv_partial_match? | ||
create_task(match: :any, passed: nil) | ||
|
||
create_note( | ||
body: <<-HTML | ||
[GOV UK One Login Name] - Names partially match: | ||
<pre> | ||
Provider: "#{claim.eligibility.practitioner_name}" | ||
GOV.UK One Login: "#{claim.onelogin_idv_full_name}" | ||
</pre> | ||
HTML | ||
) | ||
elsif claim.one_login_idv_match? | ||
create_task(match: nil, passed: false) | ||
|
||
create_note( | ||
body: <<-HTML | ||
[GOV UK One Login Name] - Names do not match: | ||
<pre> | ||
Provider: "#{claim.eligibility.practitioner_name}" | ||
GOV.UK One Login: "#{claim.onelogin_idv_full_name}" | ||
</pre> | ||
HTML | ||
) | ||
else | ||
create_task(match: :none, passed: false) | ||
|
||
create_note( | ||
body: <<-HTML | ||
[GOV UK One Login] - IDV mismatch: | ||
<pre> | ||
GOV.UK One Login Name: "#{claim.onelogin_idv_full_name}" | ||
GOV.UK One Login DOB: "#{claim.onelogin_idv_date_of_birth}" | ||
</pre> | ||
HTML | ||
) | ||
end | ||
end | ||
|
||
private | ||
|
||
def one_login_idv_match? | ||
return false unless claim.one_login_idv_match? | ||
|
||
claim.eligibility.practitioner_and_provider_entered_names_match? | ||
end | ||
|
||
def one_login_idv_partial_match? | ||
return false unless claim.one_login_idv_match? | ||
|
||
claim.eligibility.practitioner_and_provider_entered_names_partial_match? | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
app/views/admin/tasks/early_years_payments/identity_confirmation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<% content_for(:page_title) { page_title("Claim #{@claim.reference} identity confirmation check for #{@claim.policy.short_name}") } %> | ||
|
||
<% content_for :back_link do %> | ||
<%= govuk_back_link href: admin_claim_tasks_path(@claim) %> | ||
<% end %> | ||
|
||
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %> | ||
|
||
<div class="govuk-grid-row"> | ||
<%= render claim_summary_view, claim: @claim, heading: "Identity confirmation" %> | ||
|
||
<div class="govuk-grid-column-two-thirds"> | ||
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2> | ||
</div> | ||
|
||
<div class="govuk-grid-column-two-thirds"> | ||
<h3 class="govuk-heading-m"> | ||
<%= I18n.t( | ||
"admin.tasks.identity_confirmation.title", | ||
claim_full_name: @claim.full_name | ||
) %> | ||
</h3> | ||
|
||
<table class="govuk-table"> | ||
<tbody class="govuk-table__body"> | ||
<tr class="govuk-table__row"> | ||
<th scope="row" class="govuk-table__header"> | ||
Provider entered claimant name | ||
</th> | ||
<td class="govuk-table__cell"> | ||
<%= @tasks_presenter.provider_entered_claimant_name %> | ||
</td> | ||
</tr> | ||
<tr class="govuk-table__row"> | ||
<th scope="row" class="govuk-table__header"> | ||
Claimant name from One login | ||
</th> | ||
<td class="govuk-table__cell"> | ||
<%= @tasks_presenter.one_login_claimant_name %> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<% if @tasks_presenter.practitioner_journey_completed? %> | ||
<% if @task.claim_verifier_match_any? && @task.passed.nil? %> | ||
<%= render "form", task_name: "identity_confirmation", claim: @claim %> | ||
<% else %> | ||
<%= render "task_outcome", task: @task %> | ||
<% end %> | ||
<% else %> | ||
<div class="govuk-inset-text"> | ||
This task is not available until the claimant has submitted their | ||
claim. | ||
</div> | ||
<% end %> | ||
|
||
<%= render partial: "admin/task_pagination", locals: { task_pagination: @task_pagination } %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1462,6 +1462,8 @@ en: | |
task_questions: | ||
employment: | ||
title: Is the claimant still working at the current nursery above? | ||
identity_confirmation: | ||
title: "Do these names match?" | ||
early_years_payment_practitioner: | ||
journey_name: Claim an early years financial incentive payment - practitioner | ||
feedback_email: "[email protected]" | ||
|
Oops, something went wrong.