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 749eec2770..397e7a60df 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 @@ -63,18 +63,26 @@ def course_descriptions @course_descriptions ||= claim.eligibility.courses_taught.map(&:description) end + def claimant_contract_of_employment + claimant_option_selected( + "contract_type", + claim.eligibility.contract_type + ).downcase + end + def teaching_hours_per_week - I18n.t( - [ - "further_education_payments", - "forms", - "teaching_hours_per_week", - "options", - claim.eligibility.teaching_hours_per_week - ].join(".") + claimant_option_selected( + "teaching_hours_per_week", + claim.eligibility.teaching_hours_per_week ).downcase end + def claimant_contract_duration + if claim.eligibility.fixed_term_full_year + "covering the full academic year " + end + end + def assertions @assertions ||= ASSERTIONS.fetch(contract_type).map do |assertion_name| AssertionForm.new(name: assertion_name, parent_form: self) @@ -132,6 +140,18 @@ def permitted_attributes super + [assertions_attributes: AssertionForm.attribute_names] end + def claimant_option_selected(question, option) + I18n.t( + [ + "further_education_payments", + "forms", + question, + "options", + option + ].join(".") + ) + end + # Make sure the errors in the summary link to the correct nested field def all_assertions_answered assertions.each(&:validate).each_with_index do |assertion, i| diff --git a/app/models/policies/further_education_payments/eligibility.rb b/app/models/policies/further_education_payments/eligibility.rb index 2985ac085e..1e02f90d3a 100644 --- a/app/models/policies/further_education_payments/eligibility.rb +++ b/app/models/policies/further_education_payments/eligibility.rb @@ -49,7 +49,14 @@ def courses end def fixed_contract? - contract_type != "variable_hours" + case contract_type + when "permanent" + true + when "variable_hours" + false + when "fixed_term" + !!fixed_term_full_year + end end def verified? diff --git a/app/views/further_education_payments/provider/claims/verify_claim.html.erb b/app/views/further_education_payments/provider/claims/verify_claim.html.erb index 2418aa6baf..ca2f62c553 100644 --- a/app/views/further_education_payments/provider/claims/verify_claim.html.erb +++ b/app/views/further_education_payments/provider/claims/verify_claim.html.erb @@ -63,7 +63,9 @@ [:assertions, f.object.contract_type, ff.object.name, :label], claimant: f.object.claimant_name, provider: f.object.claim.school.name, - hours: f.object.teaching_hours_per_week + hours: f.object.teaching_hours_per_week, + type_of_contract: f.object.claimant_contract_of_employment, + duration: f.object.claimant_contract_duration ), }, hint: -> do diff --git a/config/locales/en.yml b/config/locales/en.yml index 85f0cddddc..76a7f9ec20 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1168,7 +1168,7 @@ en: further_education_payments_provider: journey_name: Claim a targeted retention incentive payment for further education teachers - provider feedback_email: "FE-Levellingup.PremiumPayments@education.gov.uk" - support_email_address: "FE-Levellingup.PremiumPayments@education.gov.uk" + support_email_address: "FE-targeted.retention-incentive@education.gov.uk" forms: verify_claim: title: "Review a targeted retention incentive payment claim" @@ -1185,7 +1185,7 @@ en: assertions: fixed_contract: contract_type: - label: "Does %{claimant} have a permanent contract of employment at %{provider}?" + label: "Does %{claimant} have a %{type_of_contract} of employment %{duration}at %{provider}?" errors: inclusion: "Select yes if %{claimant} has a fixed term contract of employment at %{provider}" teaching_responsibilities: @@ -1210,7 +1210,7 @@ en: inclusion: "Select yes if %{claimant} teaches this course for at least half their timetabled teaching hours" variable_contract: contract_type: - label: "Does %{claimant} have a variable hour contract of employment at %{provider}?" + label: "Does %{claimant} have a %{type_of_contract} of employment at %{provider}?" errors: inclusion: "Select yes if %{claimant} has a variable hours contract of employment at %{provider}" teaching_responsibilities: 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 5a24d6d5e9..49ef570ad4 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 @@ -272,7 +272,8 @@ :further_education_payments_eligibility, claim: claim_1, school: fe_provider, - teaching_hours_per_week: "more_than_12" + teaching_hours_per_week: "more_than_12", + contract_type: "fixed_term" ) claim_2 = create( @@ -288,7 +289,8 @@ :further_education_payments_eligibility, claim: claim_2, school: fe_provider, - teaching_hours_per_week: "more_than_12" + teaching_hours_per_week: "more_than_12", + contract_type: "fixed_term" ) mock_dfe_sign_in_auth_session( @@ -383,7 +385,7 @@ expect(page).to have_text "This claim has already been verified" end - scenario "provider approves a fixed contract claim" do + scenario "provider approves a long term fixed contract claim" do fe_provider = create(:school, :further_education, name: "Springfield A and M") claim = create( @@ -401,6 +403,7 @@ school: fe_provider, teaching_hours_per_week: "more_than_12", contract_type: "fixed_term", + fixed_term_full_year: true, subjects_taught: ["engineering_manufacturing"], engineering_manufacturing_courses: [ "approved_level_321_transportation", @@ -446,8 +449,8 @@ expect(page).to have_text "Claim date1 August 2024" within_fieldset( - "Does Edna Krabappel have a permanent contract of employment at " \ - "Springfield A and M?" + "Does Edna Krabappel have a fixed-term contract of employment covering " \ + "the full academic year at Springfield A and M?" ) do choose "Yes" end @@ -506,6 +509,147 @@ expect(page).to have_text "Claim reference number AB123456" end + scenario "provider approves a short term fixed contract claim" do + fe_provider = create(:school, :further_education, name: "Springfield A and M") + + claim = create( + :claim, + first_name: "Edna", + surname: "Krabappel", + date_of_birth: Date.new(1945, 7, 3), + reference: "AB123456", + created_at: DateTime.new(2024, 8, 1, 9, 0, 0) + ) + + create( + :further_education_payments_eligibility, + claim: claim, + school: fe_provider, + teaching_hours_per_week: "between_2_5_and_12", + contract_type: "fixed_term", + fixed_term_full_year: false, + subjects_taught: ["engineering_manufacturing"], + engineering_manufacturing_courses: [ + "approved_level_321_transportation", + "level2_3_apprenticeship" + ] + ) + + mock_dfe_sign_in_auth_session( + provider: :dfe_fe_provider, + auth_hash: { + uid: "11111", + extra: { + raw_info: { + organisation: { + id: "22222", + ukprn: fe_provider.ukprn + } + } + } + } + ) + + stub_dfe_sign_in_user_info_request( + "11111", + "22222", + Journeys::FurtherEducationPayments::Provider::CLAIM_VERIFIER_DFE_SIGN_IN_ROLE_CODE + ) + + claim_link = Journeys::FurtherEducationPayments::Provider::SlugSequence.verify_claim_url(claim) + + visit claim_link + + click_on "Start now" + + expect(page).to have_text "Review a targeted retention incentive payment claim" + # The text generated by the dl tag doesn not include a space between the + # label and value (displays as expected in browser). + expect(page).to have_text "Claim referenceAB123456" + expect(page).to have_text "Claimant nameEdna Krabappel" + expect(page).to have_text "Claimant date of birth3 July 1945" + # FIXME RL enable this test once we've added the TRN to the eligibility + # expect(page).to have_text "Claimant teacher reference number (TRN)1234567" + expect(page).to have_text "Claim date1 August 2024" + + within_fieldset( + "Does Edna Krabappel have a fixed-term contract of employment at " \ + "Springfield A and M?" + ) do + choose "Yes" + end + + within_fieldset( + "Is Edna Krabappel a member of staff with teaching responsibilities?" + ) do + choose "Yes" + end + + within_fieldset( + "Is Edna Krabappel in the first 5 years of their further education " \ + "teaching career in England?" + ) do + choose "Yes" + end + + within_fieldset( + "Has Edna Krabappel taught for at least one academic term at " \ + "Springfield A and M?" + ) do + choose "Yes" + end + + within_fieldset( + "Is Edna Krabappel timetabled to teach an average of between 2.5 and " \ + "12 hours per week during the current term?" + ) do + choose "Yes" + end + + within_fieldset( + "For at least half of their timetabled teaching hours, does " \ + "Edna Krabappel teach 16- to 19-year-olds, including those up to " \ + "age 25 with an Education, Health and Care Plan (EHCP)?" + ) do + choose "Yes" + end + + expect(page).to have_text( + "Qualifications approved for funding at level 3 and below in the " \ + "transportation operations and maintenance (opens in new tab) sector " \ + "subject area" + ) + + expect(page).to have_text( + "Level 2 or level 3 apprenticeships in the engineering and " \ + "manufacturing occupational route (opens in new tab)" + ) + + within_fieldset( + "For at least half of their timetabled teaching hours, does " \ + "Edna Krabappel teach:" + ) do + choose "Yes" + end + + within_fieldset( + "Will Edna Krabappel be timetabled to teach at least 2.5 hours per " \ + "week next term?" + ) 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" + + expect(page).to have_content "Verification complete" + expect(page).to have_text "Claim reference number AB123456" + end + scenario "provider approves a variable contract claim" do fe_provider = create(:school, :further_education, name: "Springfield A and M") @@ -569,7 +713,7 @@ expect(page).to have_text "Claim date1 August 2024" within_fieldset( - "Does Edna Krabappel have a variable hour contract of employment at " \ + "Does Edna Krabappel have a variable hours contract of employment at " \ "Springfield A and M?" ) do choose "Yes" 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 e1036f6d1f..4e99995eda 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 @@ -21,7 +21,8 @@ :further_education_payments_eligibility, school: school, teaching_hours_per_week: teaching_hours_per_week, - contract_type: contract_type + contract_type: contract_type, + fixed_term_full_year: true ) end