Skip to content

Commit

Permalink
Merge pull request #3214 from DFE-Digital/irp-previous-residency-task
Browse files Browse the repository at this point in the history
[CAPT-1823] IRP previous residency task
  • Loading branch information
asmega authored Sep 23, 2024
2 parents 0390808 + 4c8aab4 commit 874d30e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/models/claim_checking_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def applicable_task_names
else
@applicable_task_names ||= Task::NAMES.dup.tap do |task_names|
task_names.delete("previous_payment")
task_names.delete("previous_residency")
task_names.delete("induction_confirmation") unless claim.policy == Policies::EarlyCareerPayments
task_names.delete("student_loan_amount") unless claim.policy == Policies::StudentLoans
task_names.delete("student_loan_plan") unless claim.has_ecp_or_lupp_policy? && claim.submitted_without_slc_data?
Expand Down
3 changes: 2 additions & 1 deletion app/models/policies/international_relocation_payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ module InternationalRelocationPayments
:ineligible_employment_terms,
:no_response_from_school,
:suspected_fraud,
:information_mismatch_new_details_needed
:information_mismatch_new_details_needed,
:ineligible_previous_residency
]

# Attributes to delete from claims submitted before the current academic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def applicable_task_names
tasks << "identity_confirmation"
tasks << "visa"
tasks << "arrival_date"
tasks << "previous_residency"
tasks << "employment"
tasks << "employment_contract"
tasks << "employment_start"
Expand Down
1 change: 1 addition & 0 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Task < ApplicationRecord
provider_verification
visa
arrival_date
previous_residency
qualifications
induction_confirmation
census_subjects_taught
Expand Down
23 changes: 23 additions & 0 deletions app/views/admin/tasks/previous_residency.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<% content_for(:page_title) { page_title("Claim #{@claim.reference} previous residency check for #{@claim.policy.short_name}") } %>

<% content_for :back_link do %>
<%= govuk_back_link href: admin_claim_tasks_path(claim_id: @claim.id) %>
<% end %>

<div class="govuk-grid-row">
<%= render claim_summary_view, claim: @claim %>

<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">
<% if !@task.passed.nil? %>
<%= render "task_outcome", task: @task %>
<% else %>
<%= render "form", task_name: "previous_residency", claim: @claim %>
<% end %>

<%= render partial: "admin/task_pagination" %>
</div>
</div>
6 changes: 6 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ en:
tasks:
previous_payment:
title: Check for previous payment
previous_residency:
title: Check previous residency
qualifications:
title: "Check qualification information"
induction_confirmation:
Expand Down Expand Up @@ -807,6 +809,7 @@ en:
no_response_from_school: No response from school
suspected_fraud: Suspected fraud
information_mismatch_new_details_needed: "Information mismatch - new details needed"
ineligible_previous_residency: Ineligible previous residency
eligibility_answers:
nationality: "Nationality"
passport_number: "Passport number"
Expand All @@ -821,6 +824,9 @@ en:
task_questions:
previous_payment:
title: The claimant has not received an IRP payment in AY 2023/24?
previous_residency:
title: Does the claimant meet previous residency rules?
hint: asd
matching_details:
title: "Is this claim still valid despite having matching details with other claims?"
identity_confirmation:
Expand Down
3 changes: 2 additions & 1 deletion spec/mailers/claim_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ class SomePolicy; end
reason_ineligible_employment_terms: "no",
reason_no_response_from_school: "no",
reason_suspected_fraud: "no",
reason_information_mismatch_new_details_needed: "no"
reason_information_mismatch_new_details_needed: "no",
reason_ineligible_previous_residency: "no"
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/support/admin_view_claim_feature_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def expect_page_to_have_policy_sections(policy)
when Policies::EarlyCareerPayments
["Identity confirmation", "Qualifications", "Induction confirmation", "Census subjects taught", "Employment", "Student loan plan", "Decision"]
when Policies::InternationalRelocationPayments
["Previous payment", "Identity confirmation", "Visa", "Arrival date", "Employment", "Employment contract", "Employment start", "Subject", "Teaching hours", "Decision"]
["Previous payment", "Identity confirmation", "Visa", "Arrival date", "Previous residency", "Employment", "Employment contract", "Employment start", "Subject", "Teaching hours", "Decision"]
when Policies::FurtherEducationPayments
["Identity confirmation", "Provider verification", "Student loan plan", "Decision"]
else
Expand Down

0 comments on commit 874d30e

Please sign in to comment.