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/config/locales/en.yml b/config/locales/en.yml index 2f63fe239a..6fd6e7c03a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1199,7 +1199,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 5ed1ae7acc..8ceb04f080 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 @@ -385,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( @@ -403,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", @@ -508,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") @@ -571,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"