diff --git a/app/models/claim_checking_tasks.rb b/app/models/claim_checking_tasks.rb index df2a7c49ef..2b495e8c1b 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 %w[identity_confirmation visa arrival_date employment] if policy.international_relocation_payments? + return %w[identity_confirmation visa arrival_date employment employment_contract] 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 @@ -23,6 +23,7 @@ def applicable_task_names 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? task_names.delete("arrival_date") unless claim.policy.international_relocation_payments? + task_names.delete("employment_contract") 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 35f6cec0f1..16e87daf3a 100644 --- a/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb +++ b/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb @@ -21,6 +21,12 @@ def employment ] end + def employment_contract + [ + ["Employment contract at least one year", eligibility.one_year?] + ] + end + def identity_confirmation [ ["Nationality", eligibility.nationality], diff --git a/app/models/task.rb b/app/models/task.rb index 289eb29061..c0a9e165cd 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -19,6 +19,7 @@ class Task < ApplicationRecord matching_details payroll_gender arrival_date + employment_contract visa ].freeze diff --git a/app/views/admin/tasks/employment_contract.html.erb b/app/views/admin/tasks/employment_contract.html.erb new file mode 100644 index 0000000000..08a9e683b0 --- /dev/null +++ b/app/views/admin/tasks/employment_contract.html.erb @@ -0,0 +1,27 @@ +<% content_for(:page_title) { page_title("Claim #{@claim.reference} employment contract 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: "Employment contract check" %> + +
+

<%= @current_task_name.humanize %>

+
+ +
+ <%= render "admin/claims/answers", answers: @tasks_presenter.employment_contract %> +
+ +
+ <% if !@task.passed.nil? %> + <%= render "task_outcome", task: @task %> + <% else %> + <%= render "form", task_name: "employment_contract", claim: @claim %> + <% end %> + + <%= render partial: "admin/task_pagination" %> +
+
+ + diff --git a/config/locales/en.yml b/config/locales/en.yml index 8105dee289..240b6bf473 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -156,6 +156,7 @@ en: census_subjects_taught: "Check eligible subjects are taught" visa: "Check visa" arrival_date: "Check arrival date" + employment_contract: "Check employment contract" undo_decision: approved: "Undo approval" rejected: "Undo rejection" @@ -789,6 +790,8 @@ en: title: "Does the claimant’s arrival date match the above information from their claim?" employment: title: "Does the claimant’s current school match the above information from their claim?" + employment_contract: + title: "Does the claimant’s employment contract match the above information from their claim?" further_education_payments: landing_page: Find out if you are eligible for any incentive payments for further education teachers diff --git a/spec/factories/policies/international_relocation_payments/eligibilities.rb b/spec/factories/policies/international_relocation_payments/eligibilities.rb index 8f33b3116a..5ac60aba1f 100644 --- a/spec/factories/policies/international_relocation_payments/eligibilities.rb +++ b/spec/factories/policies/international_relocation_payments/eligibilities.rb @@ -6,6 +6,7 @@ end trait :eligible do + eligible_contract eligible_date_of_entry eligible_home_office eligible_school @@ -18,5 +19,9 @@ trait :eligible_date_of_entry do date_of_entry { 1.year.ago } end + + trait :eligible_contract do + one_year { true } + end end end diff --git a/spec/support/admin_view_claim_feature_shared_examples.rb b/spec/support/admin_view_claim_feature_shared_examples.rb index 67cbc3cc5e..59a00ae4b1 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", "Visa", "Arrival date", "Employment", "Decision"] + ["Identity confirmation", "Visa", "Arrival date", "Employment", "Employment contract", "Decision"] else raise "Unimplemented policy: #{policy}" end