diff --git a/app/models/claim_checking_tasks.rb b/app/models/claim_checking_tasks.rb index e00040e4dc..f1725845fa 100644 --- a/app/models/claim_checking_tasks.rb +++ b/app/models/claim_checking_tasks.rb @@ -12,7 +12,7 @@ def initialize(claim) delegate :policy, to: :claim def applicable_task_names - return ["identity_confirmation"] if policy.international_relocation_payments? + return ["identity_confirmation", "visa"] if policy.international_relocation_payments? @applicable_task_names ||= Task::NAMES.dup.tap do |task_names| task_names.delete("induction_confirmation") unless claim.policy == Policies::EarlyCareerPayments @@ -21,6 +21,7 @@ def applicable_task_names task_names.delete("payroll_details") unless claim.must_manually_validate_bank_details? task_names.delete("matching_details") unless matching_claims.exists? task_names.delete("payroll_gender") unless claim.payroll_gender_missing? || task_names_for_claim.include?("payroll_gender") + task_names.delete("visa") unless claim.policy.international_relocation_payments? end end diff --git a/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb b/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb index e64aa294ea..9e7f35fddd 100644 --- a/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb +++ b/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb @@ -16,6 +16,12 @@ def identity_confirmation ] end + def visa + [ + ["Visa type", eligibility.visa_type] + ] + end + private delegate :eligibility, to: :claim diff --git a/app/models/task.rb b/app/models/task.rb index 8dae76bdab..b2d48af068 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -18,6 +18,7 @@ class Task < ApplicationRecord payroll_details matching_details payroll_gender + visa ].freeze belongs_to :claim diff --git a/app/views/admin/tasks/visa.html.erb b/app/views/admin/tasks/visa.html.erb new file mode 100644 index 0000000000..15958f21ae --- /dev/null +++ b/app/views/admin/tasks/visa.html.erb @@ -0,0 +1,27 @@ +<% content_for(:page_title) { page_title("Claim #{@claim.reference} visa check for #{@claim.policy.short_name}") } %> +<%= link_to "Back", admin_claim_tasks_path(claim_id: @claim.id), class: "govuk-back-link" %> +<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %> + +
+ <%= render "claim_summary", claim: @claim, heading: "Visa check" %> + +
+

<%= @current_task_name.humanize %>

+
+ +
+ <%= render "admin/claims/answers", answers: @tasks_presenter.visa %> +
+ +
+ <% if !@task.passed.nil? %> + <%= render "task_outcome", task: @task do %> + <% end %> + <% else %> + <%= render "form", task_name: "visa", claim: @claim %> + <% end %> + + <%= render partial: "admin/task_pagination" %> +
+
+ diff --git a/config/locales/en.yml b/config/locales/en.yml index 867a014da9..d07693a7cc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -153,6 +153,7 @@ en: student_loan_plan: "Check student loan plan" payroll_details: "Check bank/building society account details" census_subjects_taught: "Check eligible subjects are taught" + visa: "Check visa" undo_decision: approved: "Undo approval" rejected: "Undo rejection" @@ -778,6 +779,8 @@ en: task_questions: identity_confirmation: title: "Did %{claim_full_name} submit the claim?" + visa: + title: "Is the claimant’s visa type eligible for a claim?" further_education_payments: landing_page: Find out if you are eligible for any incentive payments for further education teachers diff --git a/spec/support/admin_view_claim_feature_shared_examples.rb b/spec/support/admin_view_claim_feature_shared_examples.rb index 939e59cbcc..60616d168c 100644 --- a/spec/support/admin_view_claim_feature_shared_examples.rb +++ b/spec/support/admin_view_claim_feature_shared_examples.rb @@ -179,7 +179,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 - ["Identity confirmation", "Decision"] + ["Identity confirmation", "Visa", "Decision"] else raise "Unimplemented policy: #{policy}" end