diff --git a/app/forms/journeys/further_education_payments/half_teaching_hours_form.rb b/app/forms/journeys/further_education_payments/half_teaching_hours_form.rb new file mode 100644 index 0000000000..8d540e34b5 --- /dev/null +++ b/app/forms/journeys/further_education_payments/half_teaching_hours_form.rb @@ -0,0 +1,27 @@ +module Journeys + module FurtherEducationPayments + class HalfTeachingHoursForm < Form + attribute :half_teaching_hours, :boolean + + validates :half_teaching_hours, + inclusion: { + in: [true, false], + message: i18n_error_message(:inclusion) + } + + def radio_options + [ + OpenStruct.new(id: true, name: "Yes"), + OpenStruct.new(id: false, name: "No") + ] + end + + def save + return false unless valid? + + journey_session.answers.assign_attributes(half_teaching_hours:) + journey_session.save! + end + end + end +end diff --git a/app/models/journeys/further_education_payments.rb b/app/models/journeys/further_education_payments.rb index 0a417d8184..dce4f4a286 100644 --- a/app/models/journeys/further_education_payments.rb +++ b/app/models/journeys/further_education_payments.rb @@ -19,7 +19,8 @@ module FurtherEducationPayments "teaching-qualification" => TeachingQualificationForm, "poor-performance" => PoorPerformanceForm, "check-your-answers" => CheckYourAnswersForm, - "ineligible" => IneligibleForm + "ineligible" => IneligibleForm, + "half-teaching-hours" => HalfTeachingHoursForm } } end diff --git a/app/models/journeys/further_education_payments/session_answers.rb b/app/models/journeys/further_education_payments/session_answers.rb index 3ef62aa669..5655f7d3f4 100644 --- a/app/models/journeys/further_education_payments/session_answers.rb +++ b/app/models/journeys/further_education_payments/session_answers.rb @@ -11,6 +11,7 @@ class SessionAnswers < Journeys::SessionAnswers attribute :teaching_qualification, :string attribute :subject_to_formal_performance_action, :boolean attribute :subject_to_disciplinary_action, :boolean + attribute :half_teaching_hours, :boolean def school @school ||= School.find(school_id) diff --git a/app/views/further_education_payments/claims/half_teaching_hours.html.erb b/app/views/further_education_payments/claims/half_teaching_hours.html.erb index fba0dba654..5a56a778e6 100644 --- a/app/views/further_education_payments/claims/half_teaching_hours.html.erb +++ b/app/views/further_education_payments/claims/half_teaching_hours.html.erb @@ -1,7 +1,24 @@ -
- FE half teaching hours goes here -
++ To apply, at least 50% of your timetabled teaching hours must include either: +
+ + <%= govuk_list [ + "a student aged 16 to 19", + "a person up to age 25 with an #{govuk_link_to("Education, Health and Care Plan (EHCP)", "https://www.gov.uk/children-with-special-educational-needs/extra-SEN-help", target: "_blank")}".html_safe + ], type: :bullet %> + + <%= f.govuk_collection_radio_buttons :half_teaching_hours, @form.radio_options, :id, :name, legend: { hidden: true } %> + + <%= f.govuk_submit %> + <% end %> +