diff --git a/app/models/policies/further_education_payments/admin_tasks_presenter.rb b/app/models/policies/further_education_payments/admin_tasks_presenter.rb index 37a3ec37a9..da9c1dfb17 100644 --- a/app/models/policies/further_education_payments/admin_tasks_presenter.rb +++ b/app/models/policies/further_education_payments/admin_tasks_presenter.rb @@ -26,6 +26,18 @@ def qualifications [] end + def employment + [] + end + + def identity_confirmation + [] + end + + def student_loan_plan + [] + end + private def verifier diff --git a/app/models/policies/further_education_payments/claim_checking_tasks.rb b/app/models/policies/further_education_payments/claim_checking_tasks.rb index f349e9bea4..b85c6adb51 100644 --- a/app/models/policies/further_education_payments/claim_checking_tasks.rb +++ b/app/models/policies/further_education_payments/claim_checking_tasks.rb @@ -12,33 +12,21 @@ def initialize(claim) delegate :policy, to: :claim def applicable_task_names - @applicable_task_names ||= Task::NAMES.dup.tap do |task_names| - task_names.delete("employment") if claim.eligibility.teacher_reference_number.blank? - - 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? - 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") - - unless claim.policy.international_relocation_payments? - task_names.delete("visa") - task_names.delete("arrival_date") - task_names.delete("employment_contract") - task_names.delete("employment_start") - task_names.delete("subject") - task_names.delete("teaching_hours") - end - end - end + tasks = [] - private + tasks << "identity_confirmation" + tasks << "provider_verification" + tasks << "employment" if claim.eligibility.teacher_reference_number.present? + tasks << "student_loan_plan" + tasks << "payroll_details" + tasks << "matching_details" if matching_claims.exists? + tasks << "payroll_gender" if claim.payroll_gender_missing? - def task_names_for_claim - claim.tasks.pluck(:name) + tasks end + private + def matching_claims @matching_claims ||= Claim::MatchingAttributeFinder.new(claim).matching_claims end diff --git a/spec/support/admin_view_claim_feature_shared_examples.rb b/spec/support/admin_view_claim_feature_shared_examples.rb index d9ce17773c..f9bb1f79bf 100644 --- a/spec/support/admin_view_claim_feature_shared_examples.rb +++ b/spec/support/admin_view_claim_feature_shared_examples.rb @@ -181,7 +181,7 @@ def expect_page_to_have_policy_sections(policy) when Policies::InternationalRelocationPayments ["Identity confirmation", "Visa", "Arrival date", "Employment", "Employment contract", "Employment start", "Subject", "Teaching hours", "Decision"] when Policies::FurtherEducationPayments - ["Identity confirmation", "Provider verification", "Qualifications", "Census subjects taught", "Matching details", "Decision"] + ["Identity confirmation", "Provider verification", "Student loan plan", "Payroll details", "Matching details", "Decision"] else raise "Unimplemented policy: #{policy}" end