From 4ad73d845084fdcf49bc85fe1d2bf82c92c9bd12 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Wed, 2 Oct 2024 13:46:07 +0100 Subject: [PATCH] Add new provider verification questions Updates the provider verification form to ask the provider to verify that the claimant isn't subject to any performance or disciplinary measures. --- .../provider/verify_claim_form.rb | 7 ++++ ...in_provider_verification_task_presenter.rb | 25 ++++++++++- config/locales/en.yml | 26 ++++++++++++ .../provider_verifying_claims_spec.rb | 42 +++++++++++++++++++ .../provider/verify_claim_form_spec.rb | 16 ++++++- 5 files changed, 113 insertions(+), 3 deletions(-) diff --git a/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb b/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb index 3ca5f3c5b7..a896f10c17 100644 --- a/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb +++ b/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb @@ -4,6 +4,9 @@ module Provider class VerifyClaimForm < Form include CoursesHelper + # When adding new assertions, try to use the same name as the attribute + # in the eligibility model. This simplifies displaying the + # corresponding claimant answer in the admin ui. ASSERTIONS = { fixed_contract: %i[ contract_type @@ -12,6 +15,8 @@ class VerifyClaimForm < Form teaching_hours_per_week half_teaching_hours subjects_taught + subject_to_formal_performance_action + subject_to_disciplinary_action ], variable_contract: %i[ contract_type @@ -22,6 +27,8 @@ class VerifyClaimForm < Form half_teaching_hours subjects_taught teaching_hours_per_week_next_term + subject_to_formal_performance_action + subject_to_disciplinary_action ] } diff --git a/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb b/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb index a8ac063ad6..22ec55f0d8 100644 --- a/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb +++ b/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb @@ -43,8 +43,22 @@ def verification @verification ||= claim.eligibility.verification end + # See the `courses_taught_assertion` method for more information on why + # that assertion is different to the others. + # We need to make sure that when presenting the list of assertions to the + # admin that the courses taught assertion is displayed after the subjects + # taught assertion. def assertions - verification["assertions"] + [courses_taught_assertion] + return @assertions if @assertions + + subjects_taught_index = verification["assertions"].find_index do |h| + h["name"] == "subjects_taught" + end + + @assertions = verification["assertions"].dup.insert( + subjects_taught_index + 1, + courses_taught_assertion + ) end # The provider verifies the courses taught question as part of verifying the @@ -101,7 +115,14 @@ def claimant_answer(assertion) end def provider_answer(assertion) - assertion["outcome"] ? "Yes" : "No" + case assertion["name"] + when "subject_to_formal_performance_action", "subject_to_disciplinary_action" + # Due to the phrasing of the question to the provider, we need to + # negate their answer when displaying it in the admin ui. + assertion["outcome"] ? "No" : "Yes" + else + assertion["outcome"] ? "Yes" : "No" + end end def subjects_taught diff --git a/config/locales/en.yml b/config/locales/en.yml index 20cbaf5b50..4a1607c83c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -926,6 +926,16 @@ en: claimant_answers: true: "Yes" false: "No" + subject_to_formal_performance_action: + label: "Performance measures" + claimant_answers: + true: "Yes" + false: "No" + subject_to_disciplinary_action: + label: "Disciplinary action" + claimant_answers: + true: "Yes" + false: "No" forms: ineligible: courses: @@ -1247,6 +1257,14 @@ en: label: "For at least half of their timetabled teaching hours, does %{claimant} teach:" errors: inclusion: "Select yes if %{claimant} teaches this course for at least half their timetabled teaching hours" + subject_to_formal_performance_action: + label: "Can you confirm that %{claimant} is not currently subject to any performance measures?" + errors: + inclusion: "Select yes if %{claimant} is not currently subject to any performance measures" + subject_to_disciplinary_action: + label: "Can you confirm that %{claimant} is not currently subject to disciplinary action?" + errors: + inclusion: "Select yes if %{claimant} is not currently subject to disciplinary action" variable_contract: contract_type: label: "Does %{claimant} have a %{type_of_contract} of employment at %{provider}?" @@ -1280,6 +1298,14 @@ en: label: "Will %{claimant} be timetabled to teach at least 2.5 hours per week next term?" errors: inclusion: "Select yes if %{claimant} will be timetabled to teach at least 2.5 hours per week next term" + subject_to_formal_performance_action: + label: "Can you confirm that %{claimant} is not currently subject to any performance measures?" + errors: + inclusion: "Select yes if %{claimant} is not currently subject to any performance measures" + subject_to_disciplinary_action: + label: "Can you confirm that %{claimant} is not currently subject to disciplinary action?" + errors: + inclusion: "Select yes if %{claimant} is not currently subject to disciplinary action" early_years_payment: claim_description: for an early years financial incentive payment diff --git a/spec/features/further_education_payments/provider/provider_verifying_claims_spec.rb b/spec/features/further_education_payments/provider/provider_verifying_claims_spec.rb index 082e27a21a..f326b2285e 100644 --- a/spec/features/further_education_payments/provider/provider_verifying_claims_spec.rb +++ b/spec/features/further_education_payments/provider/provider_verifying_claims_spec.rb @@ -501,6 +501,20 @@ choose "Yes" end + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to any " \ + "performance measures?" + ) do + choose "Yes" + end + + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to " \ + "disciplinary action?" + ) do + choose "Yes" + end + check "To the best of my knowledge, I confirm that the information provided in this form is correct." click_on "Submit" @@ -639,6 +653,20 @@ choose "Yes" end + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to any " \ + "performance measures?" + ) do + choose "Yes" + end + + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to " \ + "disciplinary action?" + ) do + choose "Yes" + end + check( "To the best of my knowledge, I confirm that the information " \ "provided in this form is correct." @@ -779,6 +807,20 @@ choose "Yes" end + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to any " \ + "performance measures?" + ) do + choose "Yes" + end + + within_fieldset( + "Can you confirm that Edna Krabappel is not currently subject to " \ + "disciplinary action?" + ) do + choose "Yes" + end + check( "To the best of my knowledge, I confirm that the information " \ "provided in this form is correct." diff --git a/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb b/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb index 688724d4f3..202f51f7fb 100644 --- a/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb @@ -108,6 +108,8 @@ teaching_hours_per_week half_teaching_hours subjects_taught + subject_to_formal_performance_action + subject_to_disciplinary_action ] ) end @@ -132,6 +134,8 @@ half_teaching_hours subjects_taught teaching_hours_per_week_next_term + subject_to_formal_performance_action + subject_to_disciplinary_action ] ) end @@ -267,7 +271,9 @@ "2": {name: "further_education_teaching_start_year", outcome: "1"}, "3": {name: "teaching_hours_per_week", outcome: "1"}, "4": {name: "half_teaching_hours", outcome: "0"}, - "5": {name: "subjects_taught", outcome: "0"} + "5": {name: "subjects_taught", outcome: "0"}, + "6": {name: "subject_to_formal_performance_action", outcome: "0"}, + "7": {name: "subject_to_disciplinary_action", outcome: "0"} } } } @@ -317,6 +323,14 @@ { "name" => "subjects_taught", "outcome" => false + }, + { + "name" => "subject_to_formal_performance_action", + "outcome" => false + }, + { + "name" => "subject_to_disciplinary_action", + "outcome" => false } ], "verifier" => {