diff --git a/spec/dummy-app-wizard-specs/register_ect_wizard_spec.rb b/spec/dummy-app-wizard-specs/register_ect_wizard_spec.rb index ca3a045..a8f31f6 100644 --- a/spec/dummy-app-wizard-specs/register_ect_wizard_spec.rb +++ b/spec/dummy-app-wizard-specs/register_ect_wizard_spec.rb @@ -109,9 +109,13 @@ wizard.state_store.write( trn: '9999999', date_of_birth: Date.new(2000, 1, 1), + start_date: Date.new(2024, 9, 17), + working_pattern: 'full_time', email: 'free@example.com', school_type: 'independent', training_programme: 'provider_led', + appropriate_body_type: 'national', + lead_provider_id: 'teach_first', details_correct: 'no', correct_full_name: 'Some full name', ) @@ -258,6 +262,8 @@ wizard.state_store.write( trn: '9999999', date_of_birth: Date.new(2000, 1, 1), + start_date: Date.new(2024, 9, 17), + working_pattern: 'full_time', details_correct: 'yes', email: 'free@example.com', school_type: 'state', @@ -353,10 +359,13 @@ def stub_eligible_path(wizard) wizard.state_store.write( trn: '9999999', date_of_birth: Date.new(2000, 1, 1), + start_date: Date.new(2024, 9, 17), + working_pattern: 'full_time', email: 'free@example.com', training_programme: 'school_led', details_correct: 'yes', school_type: 'independent', + appropriate_body_type: 'national', ) end end diff --git a/spec/features/register_ect_wizard_spec.rb b/spec/features/register_ect_wizard_spec.rb new file mode 100644 index 0000000..5eedb91 --- /dev/null +++ b/spec/features/register_ect_wizard_spec.rb @@ -0,0 +1,328 @@ +RSpec.feature 'Register ECT wizard', type: :feature do + scenario 'happy path with provider-led training' do + given_i_start_the_register_ect_wizard + then_i_should_be_on_the_find_ect_step + + when_i_complete_happy_path_to_check_answers + and_i_see_the_check_answers_summary( + 'Name' => 'Pat ECT', + 'Teacher Reference Number (TRN)' => '1234567', + 'Email address' => 'ect@example.com', + 'School start date' => '17 September 2024', + 'Working pattern' => 'Full time', + 'Appropriate body' => 'Example Appropriate Body', + 'Training programme' => 'Provider led', + 'Lead provider' => 'Teach first', + ) + and_i_confirm_details + + then_i_should_be_on_the_confirmation_step + and_i_see_the_confirmation_summary + end + + scenario 'change answers returns to check answers' do + given_i_start_the_register_ect_wizard + then_i_should_be_on_the_find_ect_step + + when_i_complete_happy_path_to_check_answers + + when_i_change_working_pattern_to('Part time') + + then_i_should_be_on_the_check_answers_step + and_i_see_the_check_answers_summary('Working pattern' => 'Part time') + end + + scenario 'change programme details returns to check answers' do + given_i_start_the_register_ect_wizard + then_i_should_be_on_the_find_ect_step + + when_i_complete_happy_path_to_check_answers + + when_i_change_training_programme_to('School-led') + + then_i_should_be_on_the_check_answers_step + and_i_see_the_check_answers_summary('Training programme' => 'School led') + and_i_do_not_see_lead_provider_in_summary + end + + scenario 'change appropriate body returns to check answers for independent schools' do + given_i_start_the_register_ect_wizard_for_independent_school + then_i_should_be_on_the_find_ect_step + + when_i_complete_happy_path_to_check_answers_for_independent_school + + when_i_change_independent_appropriate_body_to('Independent Body Two') + + then_i_should_be_on_the_check_answers_step + and_i_see_the_check_answers_summary('Appropriate body' => 'Independent Body Two') + end + + scenario 'when TRN is not found' do + given_i_start_the_register_ect_wizard + then_i_should_be_on_the_find_ect_step + + when_i_find_an_ect(trn: '0000000', day: '1', month: '11', year: '1980') + then_i_should_be_on_the_trn_not_found_step + when_i_try_again + then_i_should_be_on_the_find_ect_step + end + + scenario 'skipping steps' do + when_i_go_to_the_programme_type_step_directly + then_i_see_a_404 + + when_i_go_to_the_check_answers_step_directly + then_i_see_a_404 + + when_i_go_to_the_confirmation_step_directly + then_i_see_a_404 + end + + def given_i_start_the_register_ect_wizard + visit root_path + click_link_or_button 'Wizards' + click_link_or_button 'Register ECT Wizard' + end + + def given_i_start_the_register_ect_wizard_for_independent_school + visit register_ect_find_ect_path(school_type: 'independent') + end + + def then_i_should_be_on_the_find_ect_step + expect(page).to have_current_path(register_ect_find_ect_path, ignore_query: true) + expect(page).to have_content('Find an ECT') + end + + def when_i_find_an_ect(trn:, day:, month:, year:) + fill_in 'Teacher reference number (TRN)', with: trn + fill_in 'Day', with: day + fill_in 'Month', with: month + fill_in 'Year', with: year + and_i_continue + end + + def then_i_should_be_on_the_review_ect_details_step + expect(page).to have_current_path(register_ect_review_ect_details_path, ignore_query: true) + expect(page).to have_content('Review ECT details') + end + + def when_i_complete_happy_path_to_check_answers + when_i_find_an_ect(trn: '1234567', day: '1', month: '11', year: '1980') + then_i_should_be_on_the_review_ect_details_step + when_i_confirm_ect_details_and_enter_name('Pat ECT') + and_i_continue + + then_i_should_be_on_the_email_address_step + when_i_enter_email('ect@example.com') + and_i_continue + + then_i_should_be_on_the_start_date_step + when_i_enter_start_date(day: '17', month: '9', year: '2024') + and_i_continue + + then_i_should_be_on_the_working_pattern_step + when_i_choose_working_pattern('Full time') + and_i_continue + + then_i_should_be_on_the_state_school_appropriate_body_step + when_i_enter_appropriate_body_name('Example Appropriate Body') + and_i_continue + + then_i_should_be_on_the_programme_type_step + when_i_choose_training_programme('Provider-led') + and_i_continue + + then_i_should_be_on_the_lead_provider_step + when_i_choose_lead_provider('Teach First') + and_i_continue + + then_i_should_be_on_the_check_answers_step + end + + def when_i_complete_happy_path_to_check_answers_for_independent_school + when_i_find_an_ect(trn: '1234567', day: '1', month: '11', year: '1980') + then_i_should_be_on_the_review_ect_details_step + when_i_confirm_ect_details_and_enter_name('Pat ECT') + and_i_continue + + then_i_should_be_on_the_email_address_step + when_i_enter_email('ect@example.com') + and_i_continue + + then_i_should_be_on_the_start_date_step + when_i_enter_start_date(day: '17', month: '9', year: '2024') + and_i_continue + + then_i_should_be_on_the_working_pattern_step + when_i_choose_working_pattern('Full time') + and_i_continue + + then_i_should_be_on_the_independent_school_appropriate_body_step + when_i_choose_independent_appropriate_body('Independent Body One') + and_i_continue + + then_i_should_be_on_the_programme_type_step + when_i_choose_training_programme('Provider-led') + and_i_continue + + then_i_should_be_on_the_lead_provider_step + when_i_choose_lead_provider('Teach First') + and_i_continue + + then_i_should_be_on_the_check_answers_step + end + + def when_i_change_working_pattern_to(value) + find('.govuk-summary-list__row', text: 'Working pattern').click_link('Change') + then_i_should_be_on_the_working_pattern_step + when_i_choose_working_pattern(value) + and_i_continue + end + + def when_i_change_training_programme_to(value) + find('.govuk-summary-list__row', text: 'Training programme').click_link('Change') + then_i_should_be_on_the_programme_type_step + when_i_choose_training_programme(value) + and_i_continue + end + + def when_i_change_independent_appropriate_body_to(name) + find('.govuk-summary-list__row', text: 'Appropriate body').click_link('Change') + then_i_should_be_on_the_independent_school_appropriate_body_step + when_i_choose_independent_appropriate_body(name) + and_i_continue + end + + def when_i_confirm_ect_details_and_enter_name(name) + choose 'No, they changed their name or it\'s spelt wrong' + fill_in 'Enter the correct full name', with: name + end + + def then_i_should_be_on_the_email_address_step + expect(page).to have_current_path(register_ect_email_address_path, ignore_query: true) + expect(page).to have_content('email address') + end + + def when_i_enter_email(email) + fill_in 'Email address', with: email + end + + def then_i_should_be_on_the_start_date_step + expect(page).to have_current_path(register_ect_start_date_path, ignore_query: true) + expect(page).to have_content('start teaching as an ECT') + end + + def when_i_enter_start_date(day:, month:, year:) + fill_in 'Day', with: day + fill_in 'Month', with: month + fill_in 'Year', with: year + end + + def then_i_should_be_on_the_working_pattern_step + expect(page).to have_current_path(register_ect_working_pattern_path, ignore_query: true) + expect(page).to have_content('working pattern') + end + + def when_i_choose_working_pattern(value) + choose value + end + + def then_i_should_be_on_the_state_school_appropriate_body_step + expect(page).to have_current_path(register_ect_state_school_appropriate_body_path, ignore_query: true) + expect(page).to have_content('appropriate body') + end + + def then_i_should_be_on_the_independent_school_appropriate_body_step + expect(page).to have_current_path(register_ect_independent_school_appropriate_body_path, ignore_query: true) + expect(page).to have_content('appropriate body') + end + + def when_i_enter_appropriate_body_name(name) + fill_in 'Enter appropriate body name', with: name + end + + def when_i_choose_independent_appropriate_body(name) + choose 'A different appropriate body (teaching school hub)' + fill_in 'Enter appropriate body name', with: name + end + + def then_i_should_be_on_the_programme_type_step + expect(page).to have_current_path(register_ect_programme_type_path, ignore_query: true) + expect(page).to have_content('training programme') + end + + def when_i_choose_training_programme(value) + choose value + end + + def then_i_should_be_on_the_lead_provider_step + expect(page).to have_current_path(register_ect_lead_provider_path, ignore_query: true) + expect(page).to have_content('lead provider') + end + + def when_i_choose_lead_provider(name) + choose name + end + + def then_i_should_be_on_the_check_answers_step + expect(page).to have_current_path(register_ect_check_answers_path, ignore_query: true) + expect(page).to have_content('Check your answers before submitting') + end + + def and_i_see_the_check_answers_summary(fields_and_answers) + fields_and_answers.each do |field, answer| + expect(page).to have_text(field) + expect(page).to have_text(answer) + end + end + + def and_i_confirm_details + click_link_or_button 'Confirm details' + end + + def then_i_should_be_on_the_confirmation_step + expect(page).to have_current_path(register_ect_confirmation_path, ignore_query: true) + expect(page).to have_content('You have saved') + end + + def and_i_see_the_confirmation_summary + expect(page).to have_content('Assign a mentor') + end + + def and_i_do_not_see_lead_provider_in_summary + expect(page).to have_no_content('Lead provider') + end + + def then_i_should_be_on_the_trn_not_found_step + expect(page).to have_current_path(register_ect_trn_not_found_path, ignore_query: true) + expect(page).to have_content('unable to match the ECT with the TRN you provided') + end + + def when_i_try_again + click_link_or_button 'Try again' + end + + def when_i_go_to_the_programme_type_step_directly + visit register_ect_programme_type_path + end + + def when_i_go_to_the_check_answers_step_directly + visit register_ect_check_answers_path + end + + def when_i_go_to_the_confirmation_step_directly + visit register_ect_confirmation_path + end + + def then_i_see_a_404 + expect(page.status_code).to eq(404) + end + + def and_i_continue + if page.has_button?('Continue') + click_button 'Continue' + else + click_button 'Confirm and continue' + end + end +end diff --git a/spec/rails-dummy/app/controllers/register_ect/wizard_controller.rb b/spec/rails-dummy/app/controllers/register_ect/wizard_controller.rb index d06d7c5..5e8e685 100644 --- a/spec/rails-dummy/app/controllers/register_ect/wizard_controller.rb +++ b/spec/rails-dummy/app/controllers/register_ect/wizard_controller.rb @@ -1,6 +1,7 @@ module RegisterECT class WizardController < ApplicationController before_action :assign_wizard + before_action :verify_step_access def new = nil @@ -14,10 +15,18 @@ def create private + def verify_step_access + unless @wizard.valid_path_to_current_step? + render status: :not_found, formats: [:html], + template: 'errors/not_found' + end + end + def assign_wizard state_store = StateStores::RegisterECTStore.new( repository: DfE::Wizard::Repository::Session.new(session:, key: :register_ect_wizard), ) + state_store.write(school_type: params[:school_type]) if params[:school_type].present? @wizard = RegisterECTWizard.new( current_step: current_step, diff --git a/spec/rails-dummy/app/views/register_ect/cant_use_email/new.html.erb b/spec/rails-dummy/app/views/register_ect/cant_use_email/new.html.erb new file mode 100644 index 0000000..69a2436 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/cant_use_email/new.html.erb @@ -0,0 +1,13 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_email_address_path %> + +
+
+

This email is already in use for a different ECT or mentor

+ +

Make sure you use an email that belongs to the person you’re registering.

+ +

Do not use a generic email like headteacher@school.com.

+ + <%= govuk_link_to "Try another email", @wizard.previous_step_path, class: "govuk-button" %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/check_answers/new.html.erb b/spec/rails-dummy/app/views/register_ect/check_answers/new.html.erb new file mode 100644 index 0000000..43baf8b --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/check_answers/new.html.erb @@ -0,0 +1,76 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_find_ect_path %> + +
+
+

Check your answers before submitting

+ +

Teacher details

+ + <% teacher_details_reviewable_attributes = %w[correct_full_name trn email start_date working_pattern] %> + + <%= govuk_summary_list do |summary_list| %> + <% @wizard.flow_steps.each do |step| %> + <% step.attributes.each do |attribute_name, attribute_value| %> + <% next unless attribute_name.in?(teacher_details_reviewable_attributes) %> + <%= summary_list.with_row do |row| %> + <%= row.with_key { step.class.human_attribute_name(attribute_name) } %> + + <% if attribute_name == "working_pattern" %> + <%= row.with_value { attribute_value.humanize } %> + <% else %> + <%= row.with_value { attribute_value.is_a?(Date) ? attribute_value.to_fs(:govuk_date) : attribute_value.to_s } %> + <% end %> + <%= row.with_action( + text: "Change", + href: @wizard.resolve_step_path(step.step_id, return_to_review: step.step_id), + visually_hidden_text: attribute_name + ) %> + <% end %> + <% end %> + <% end %> + <% end %> + +

Programme details

+ + <% programme_details_reviewable_attributes = %w[lead_provider_id training_programme] %> + + <%= govuk_summary_list do |summary_list| %> + <% @wizard.flow_steps.each do |step| %> + <% step.attributes.each do |attribute_name, attribute_value| %> + <% next unless attribute_name.in?(programme_details_reviewable_attributes) %> + <%= summary_list.with_row do |row| %> + <%= row.with_key { step.class.human_attribute_name(attribute_name) } %> + <%= row.with_value { attribute_value.humanize } %> + <%= row.with_action( + text: "Change", + href: @wizard.resolve_step_path(step.step_id, return_to_review: step.step_id), + visually_hidden_text: attribute_name + ) %> + <% end %> + <% end %> + <% end %> + + <%= summary_list.with_row do |row| %> + <%= row.with_key { "Appropriate body" } %> + <%= row.with_value { @wizard.state_store.appropriate_body_text } %> + <%= row.with_action( + text: "Change", + href: @wizard.resolve_step_path( + @wizard.state_store.school_independent? ? :independent_school_appropriate_body : :state_school_appropriate_body, + return_to_review: @wizard.state_store.school_independent? ? :independent_school_appropriate_body : :state_school_appropriate_body + ), + visually_hidden_text: "appropriate body" + ) %> + <% end %> + <% end %> + + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path, + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.hidden_field :confirm, value: "1" %> + <%= f.govuk_submit "Confirm details" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/confirmation/new.html.erb b/spec/rails-dummy/app/views/register_ect/confirmation/new.html.erb new file mode 100644 index 0000000..3a2824b --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/confirmation/new.html.erb @@ -0,0 +1,16 @@ +
+
+

You have saved <%= @wizard.state_store.read[:correct_full_name].presence || "the ECT" %>’s details

+ +

We’ll email them to let them know. They do not need to provide us with any more information.

+ +

You still need to assign a mentor

+

You can either assign a mentor now or return and do it later. You need to do this to complete their registration.

+ + <%= govuk_link_to "Assign a mentor", assign_mentor_who_will_be_the_mentor_path, class: "govuk-button" %> + +

+ <%= govuk_link_to "Back to your ECTs", wizards_path %> +

+
+
diff --git a/spec/rails-dummy/app/views/register_ect/email_address/new.html.erb b/spec/rails-dummy/app/views/register_ect/email_address/new.html.erb index e2c8500..6dc3b49 100644 --- a/spec/rails-dummy/app/views/register_ect/email_address/new.html.erb +++ b/spec/rails-dummy/app/views/register_ect/email_address/new.html.erb @@ -12,7 +12,7 @@

Do not use a generic email like headteacher@school.com.

<%= form_with(model: @wizard.current_step, - url: @wizard.current_step_path, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), scope: @wizard.current_step_name) do |f| %> <%= f.govuk_error_summary %> diff --git a/spec/rails-dummy/app/views/register_ect/find_ect/new.html.erb b/spec/rails-dummy/app/views/register_ect/find_ect/new.html.erb index 27b2472..8fa9340 100644 --- a/spec/rails-dummy/app/views/register_ect/find_ect/new.html.erb +++ b/spec/rails-dummy/app/views/register_ect/find_ect/new.html.erb @@ -7,7 +7,7 @@

Enter the ECT's teacher reference number and date of birth to find their teaching record.

<%= form_with(model: @wizard.current_step, - url: @wizard.current_step_path, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), scope: @wizard.current_step_name) do |f| %> <%= f.govuk_error_summary %> diff --git a/spec/rails-dummy/app/views/register_ect/independent_school_appropriate_body/new.html.erb b/spec/rails-dummy/app/views/register_ect/independent_school_appropriate_body/new.html.erb new file mode 100644 index 0000000..d9134f8 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/independent_school_appropriate_body/new.html.erb @@ -0,0 +1,35 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_working_pattern_path %> + +
+
+ <% name = @wizard.state_store.read[:correct_full_name].presence || "the ECT" %> +

Which appropriate body will be supporting <%= name %>’s induction?

+ +

Appropriate bodies are responsible for assuring the quality of the statutory induction of ECTs.

+ +

We share the ECT’s details with the appropriate body to check the ECT has been registered correctly.

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_radio_buttons_fieldset :appropriate_body_type, + legend: { text: "What type of appropriate body will be supporting #{name}’s induction", hidden: true } do %> + <%= f.govuk_radio_button :appropriate_body_type, + "national", + label: { text: "Independent Schools Teacher Induction Panel (ISTIP)" }, + link_errors: true %> + + <%= f.govuk_radio_button :appropriate_body_type, + "teaching_school_hub", + label: { text: "A different appropriate body (teaching school hub)" } do %> + <%= f.govuk_text_field :independent_appropriate_body_name, + label: { text: "Enter appropriate body name" } %> + <% end %> + <% end %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/lead_provider/new.html.erb b/spec/rails-dummy/app/views/register_ect/lead_provider/new.html.erb new file mode 100644 index 0000000..f868e63 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/lead_provider/new.html.erb @@ -0,0 +1,25 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_programme_type_path %> + +
+
+

Which lead provider will be training <%= name = @wizard.state_store.read[:correct_full_name].presence || "the ECT" %>?

+ +

Lead providers are responsible for creating the materials and learning platforms used for training ECTs and mentors.

+ +

We will let the lead provider know your school wants to work with them so they can arrange training. They’ll confirm which delivery partner they’ll be working with to deliver training events.

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_radio_buttons_fieldset :lead_provider_id, legend: { text: "Select lead provider", hidden: true } do %> + <%= f.govuk_radio_button :lead_provider_id, "teach_first", label: { text: "Teach First" }, link_errors: true %> + <%= f.govuk_radio_button :lead_provider_id, "ambition", label: { text: "Ambition Institute" } %> + <%= f.govuk_radio_button :lead_provider_id, "ucl", label: { text: "UCL Institute of Education" } %> + <% end %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/national_insurance_number/new.html.erb b/spec/rails-dummy/app/views/register_ect/national_insurance_number/new.html.erb index 8d43de7..afd926b 100644 --- a/spec/rails-dummy/app/views/register_ect/national_insurance_number/new.html.erb +++ b/spec/rails-dummy/app/views/register_ect/national_insurance_number/new.html.erb @@ -7,7 +7,7 @@

We cannot find a match with the details you've given. You'll need to provide more information about your ECT to help us locate them.

<%= form_with(model: @wizard.current_step, - url: @wizard.current_step_path, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), scope: @wizard.current_step_name) do |f| %> <%= f.govuk_error_summary %> diff --git a/spec/rails-dummy/app/views/register_ect/not_found/new.html.erb b/spec/rails-dummy/app/views/register_ect/not_found/new.html.erb new file mode 100644 index 0000000..b9d4ab0 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/not_found/new.html.erb @@ -0,0 +1,13 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_find_ect_path %> + +
+
+

We’re unable to match the ECT with the details you provided

+ +

Check that you’ve entered their details correctly.

+

You can check their TRN by <%= govuk_link_to('reviewing their teacher record', 'https://www.gov.uk/guidance/check-a-teachers-record') %>.

+

Alternatively, you can ask the ECT to check their TRN by using the <%= govuk_link_to('Find a lost TRN service', 'https://find-a-lost-trn.education.gov.uk/start') %>.

+ + <%= govuk_link_to "Try again", register_ect_find_ect_path, class: "govuk-button" %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/programme_type/new.html.erb b/spec/rails-dummy/app/views/register_ect/programme_type/new.html.erb new file mode 100644 index 0000000..86bf4f3 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/programme_type/new.html.erb @@ -0,0 +1,29 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_working_pattern_path %> + +
+
+ <% name = @wizard.state_store.read[:correct_full_name].presence || "the ECT" %> +

Which training programme will <%= name %> follow?

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_radio_buttons_fieldset :training_programme, + legend: { text: "Which training programme will #{name} follow?", hidden: true } do %> + <%= f.govuk_radio_button :training_programme, + "provider_led", + label: { text: "Provider-led" }, + hint: { text: "Your school will use DfE funded providers to design and deliver training based on the initial teacher training and early career framework" }, + link_errors: true %> + <%= f.govuk_radio_button :training_programme, + "school_led", + label: { text: "School-led" }, + hint: { text: "Your school will design and deliver its own training based on the initial teacher training and early career framework" } %> + <% end %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/review_ect_details/new.html.erb b/spec/rails-dummy/app/views/register_ect/review_ect_details/new.html.erb index 63eed7f..41006a8 100644 --- a/spec/rails-dummy/app/views/register_ect/review_ect_details/new.html.erb +++ b/spec/rails-dummy/app/views/register_ect/review_ect_details/new.html.erb @@ -33,7 +33,7 @@ <% end %> <%= form_with(model: @wizard.current_step, - url: @wizard.current_step_path, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), scope: @wizard.current_step_name) do |f| %> <%= f.govuk_error_summary %> diff --git a/spec/rails-dummy/app/views/register_ect/start_date/new.html.erb b/spec/rails-dummy/app/views/register_ect/start_date/new.html.erb new file mode 100644 index 0000000..e67503e --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/start_date/new.html.erb @@ -0,0 +1,20 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_email_address_path %> + +
+
+

When did or when will <%= @wizard.state_store.read[:correct_full_name].presence || "the ECT" %> start teaching as an ECT at your school?

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_date_field :start_date, + width: "two-thirds", + legend: { text: "Start date", size: "m", tag: "h2", hidden: true }, + hint: { text: "For example, 17 9 #{Date.current.year}" } %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/state_school_appropriate_body/new.html.erb b/spec/rails-dummy/app/views/register_ect/state_school_appropriate_body/new.html.erb new file mode 100644 index 0000000..6d2a54c --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/state_school_appropriate_body/new.html.erb @@ -0,0 +1,23 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_working_pattern_path %> + +
+
+ <% name = @wizard.state_store.read[:correct_full_name].presence || "the ECT" %> +

Which appropriate body will be supporting <%= name %>’s induction?

+ +

Appropriate bodies are responsible for assuring the quality of the statutory induction of ECTs.

+ +

We share the ECT’s details with the appropriate body to check the ECT has been registered correctly.

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_text_field :appropriate_body_name, + label: { text: "Enter appropriate body name" } %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/views/register_ect/trn_not_found/new.html.erb b/spec/rails-dummy/app/views/register_ect/trn_not_found/new.html.erb index 8d43de7..eb8236b 100644 --- a/spec/rails-dummy/app/views/register_ect/trn_not_found/new.html.erb +++ b/spec/rails-dummy/app/views/register_ect/trn_not_found/new.html.erb @@ -2,22 +2,11 @@
-

We cannot find the ECT's details

+

We’re unable to match the ECT with the TRN you provided

-

We cannot find a match with the details you've given. You'll need to provide more information about your ECT to help us locate them.

+

You can check their TRN by <%= govuk_link_to('reviewing their teacher record', 'https://www.gov.uk/guidance/check-a-teachers-record') %>.

+

Alternatively, you can ask the ECT to check their TRN by using the <%= govuk_link_to('Find a lost TRN service', 'https://find-a-lost-trn.education.gov.uk/start') %>.

- <%= form_with(model: @wizard.current_step, - url: @wizard.current_step_path, - scope: @wizard.current_step_name) do |f| %> - <%= f.govuk_error_summary %> - - <%= f.govuk_text_field( - :national_insurance_number, - label: { text: "National Insurance Number", size: "m" }, - hint: { text: "Enter your ECT's National Insurance number. It's on their National Insurance card, benefit letter, payslip or P60. For example, 'QQ 12 34 56 D'." }, - ) %> - - <%= f.govuk_submit "Continue" %> - <% end %> + <%= govuk_link_to "Try again", register_ect_find_ect_path, class: "govuk-button" %>
diff --git a/spec/rails-dummy/app/views/register_ect/working_pattern/new.html.erb b/spec/rails-dummy/app/views/register_ect/working_pattern/new.html.erb new file mode 100644 index 0000000..c32bc12 --- /dev/null +++ b/spec/rails-dummy/app/views/register_ect/working_pattern/new.html.erb @@ -0,0 +1,24 @@ +<%= govuk_back_link href: @wizard.previous_step_path || register_ect_start_date_path %> + +
+
+ <% name = @wizard.state_store.read[:correct_full_name].presence || "the ECT" %> +

Is <%= name %>’s working pattern as an ECT full or part time?

+ +

We’ll pass this information on so adjustments can be made to training if needed.

+ + <%= form_with(model: @wizard.current_step, + url: @wizard.current_step_path(return_to_review: params[:return_to_review]), + scope: @wizard.current_step_name) do |f| %> + <%= f.govuk_error_summary %> + + <%= f.govuk_radio_buttons_fieldset :working_pattern, + legend: { text: "Is #{name}’s working pattern as an ECT full or part time?", hidden: true } do %> + <%= f.govuk_radio_button :working_pattern, "full_time", label: { text: "Full time" }, link_errors: true %> + <%= f.govuk_radio_button :working_pattern, "part_time", label: { text: "Part time" } %> + <% end %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/spec/rails-dummy/app/wizards/state_stores/register_ect_store.rb b/spec/rails-dummy/app/wizards/state_stores/register_ect_store.rb index 1bba37e..1ba85ac 100644 --- a/spec/rails-dummy/app/wizards/state_stores/register_ect_store.rb +++ b/spec/rails-dummy/app/wizards/state_stores/register_ect_store.rb @@ -45,6 +45,18 @@ def provider_led? read[:training_programme] == 'provider_led' end + def appropriate_body_text + appropriate_body_name = if appropriate_body_type == 'national' + 'Independent Schools Teacher Induction Panel (ISTIP)' + elsif appropriate_body_type.present? + read[:independent_appropriate_body_name] + else + read[:appropriate_body_name] + end + + appropriate_body_name.presence || 'Not provided' + end + private def trn diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/cant_use_email_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/cant_use_email_step.rb index ca956e7..44c13a6 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/cant_use_email_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/cant_use_email_step.rb @@ -2,6 +2,10 @@ module Steps module RegisterECT class CantUseEmailStep include DfE::Wizard::Step + + def self.permitted_params + [] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/check_answers_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/check_answers_step.rb index df3e80e..6b040b6 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/check_answers_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/check_answers_step.rb @@ -2,6 +2,12 @@ module Steps module RegisterECT class CheckAnswersStep include DfE::Wizard::Step + + attribute :confirm, :string + + def self.permitted_params + %w[confirm] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/confirmation_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/confirmation_step.rb index 8be4ba4..7d58825 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/confirmation_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/confirmation_step.rb @@ -2,6 +2,10 @@ module Steps module RegisterECT class ConfirmationStep include DfE::Wizard::Step + + def self.permitted_params + [] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/independent_school_appropriate_body_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/independent_school_appropriate_body_step.rb index 7d2eac5..a27e481 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/independent_school_appropriate_body_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/independent_school_appropriate_body_step.rb @@ -2,6 +2,18 @@ module Steps module RegisterECT class IndependentSchoolAppropriateBodyStep include DfE::Wizard::Step + + attribute :appropriate_body_type, :string + attribute :independent_appropriate_body_name, :string + + validates :appropriate_body_type, presence: true + validates :independent_appropriate_body_name, presence: true, if: lambda { + appropriate_body_type == 'teaching_school_hub' + } + + def self.permitted_params + %w[appropriate_body_type independent_appropriate_body_name] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/lead_provider_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/lead_provider_step.rb index 95448a8..5d1e917 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/lead_provider_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/lead_provider_step.rb @@ -2,6 +2,14 @@ module Steps module RegisterECT class LeadProviderStep include DfE::Wizard::Step + + attribute :lead_provider_id, :string + + validates :lead_provider_id, presence: true + + def self.permitted_params + %w[lead_provider_id] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/national_insurance_number_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/national_insurance_number_step.rb index d68bf9f..40f0d6a 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/national_insurance_number_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/national_insurance_number_step.rb @@ -2,6 +2,14 @@ module Steps module RegisterECT class NationalInsuranceNumberStep include DfE::Wizard::Step + + attribute :national_insurance_number, :string + + validates :national_insurance_number, presence: true + + def self.permitted_params + %w[national_insurance_number] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/not_found_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/not_found_step.rb index 9979c25..557b570 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/not_found_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/not_found_step.rb @@ -2,6 +2,10 @@ module Steps module RegisterECT class NotFoundStep include DfE::Wizard::Step + + def self.permitted_params + [] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/programme_type_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/programme_type_step.rb index d41de31..940117e 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/programme_type_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/programme_type_step.rb @@ -2,6 +2,14 @@ module Steps module RegisterECT class ProgrammeTypeStep include DfE::Wizard::Step + + attribute :training_programme, :string + + validates :training_programme, presence: true + + def self.permitted_params + %w[training_programme] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/start_date_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/start_date_step.rb index 089aecb..456e56d 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/start_date_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/start_date_step.rb @@ -2,6 +2,30 @@ module Steps module RegisterECT class StartDateStep include DfE::Wizard::Step + + attribute :start_date, :date + + validates :start_date, presence: true + + def self.permitted_params + %w[start_date(1i) start_date(2i) start_date(3i)] + end + + def assign_attributes(attrs = {}) + date_parts = attrs.symbolize_keys!.extract!(:'start_date(1i)', :'start_date(2i)', :'start_date(3i)') + + super + + if date_parts.present? && date_parts.values.all?(&:present?) + self.start_date = Date.new( + date_parts[:'start_date(1i)'].to_i, + date_parts[:'start_date(2i)'].to_i, + date_parts[:'start_date(3i)'].to_i, + ) + end + rescue ArgumentError + self.start_date = nil + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/state_school_appropriate_body_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/state_school_appropriate_body_step.rb index 6063a14..d1fdca8 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/state_school_appropriate_body_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/state_school_appropriate_body_step.rb @@ -8,6 +8,10 @@ class StateSchoolAppropriateBodyStep presence: { message: "Enter the name of the appropriate body which will be supporting the ECT's induction", } + + def self.permitted_params + %w[appropriate_body_name] + end end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/trn_not_found_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/trn_not_found_step.rb index be11336..b5e052a 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/trn_not_found_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/trn_not_found_step.rb @@ -3,12 +3,8 @@ module RegisterECT class TRNNotFoundStep include DfE::Wizard::Step - attribute :national_insurance_number, :string - - validates :national_insurance_number, presence: true - def self.permitted_params - %w[national_insurance_number] + [] end end end diff --git a/spec/rails-dummy/app/wizards/steps/register_ect/working_pattern_step.rb b/spec/rails-dummy/app/wizards/steps/register_ect/working_pattern_step.rb index ed032c6..b5aee54 100644 --- a/spec/rails-dummy/app/wizards/steps/register_ect/working_pattern_step.rb +++ b/spec/rails-dummy/app/wizards/steps/register_ect/working_pattern_step.rb @@ -2,6 +2,14 @@ module Steps module RegisterECT class WorkingPatternStep include DfE::Wizard::Step + + attribute :working_pattern, :string + + validates :working_pattern, presence: true + + def self.permitted_params + %w[working_pattern] + end end end end diff --git a/spec/rails-dummy/config/locales/register_ect.yml b/spec/rails-dummy/config/locales/register_ect.yml new file mode 100644 index 0000000..5a755dc --- /dev/null +++ b/spec/rails-dummy/config/locales/register_ect.yml @@ -0,0 +1,17 @@ +en: + activemodel: + attributes: + steps/register_ect/find_ect_step: + trn: Teacher Reference Number (TRN) + steps/register_ect/review_ect_details_step: + correct_full_name: Name + steps/register_ect/email_address_step: + email: Email address + steps/register_ect/working_pattern_step: + working_pattern: Working pattern + steps/register_ect/start_date_step: + start_date: School start date + steps/register_ect/lead_provider_step: + lead_provider_id: Lead provider + steps/register_ect/programme_type_step: + training_programme: Training programme diff --git a/spec/rails-dummy/docs/wizards/assign_mentor_wizard.md b/spec/rails-dummy/docs/wizards/assign_mentor_wizard.md index 2ab9363..10662cc 100644 --- a/spec/rails-dummy/docs/wizards/assign_mentor_wizard.md +++ b/spec/rails-dummy/docs/wizards/assign_mentor_wizard.md @@ -1,7 +1,7 @@ # Wizard Documentation **Structure Type:** `graph` -**Generated:** 2025-12-22T07:03:20Z +**Generated:** 2026-01-13T20:21:32Z **Processor:** DfE::Wizard::StepsProcessor diff --git a/spec/rails-dummy/docs/wizards/register_ect_wizard.md b/spec/rails-dummy/docs/wizards/register_ect_wizard.md index dbda8c7..82c25d1 100644 --- a/spec/rails-dummy/docs/wizards/register_ect_wizard.md +++ b/spec/rails-dummy/docs/wizards/register_ect_wizard.md @@ -1,7 +1,7 @@ # Wizard Documentation **Structure Type:** `graph` -**Generated:** 2025-12-22T07:03:20Z +**Generated:** 2026-01-13T20:21:32Z **Processor:** DfE::Wizard::StepsProcessor @@ -147,6 +147,12 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `confirm` | `ActiveModel::Type::String` | ✗ | | + #### Operations | Operation | Description | @@ -249,16 +255,6 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. -#### Attributes - -| Attribute | Type | Required | Description | -|-----------|------|:--------:|-------------| -| `national_insurance_number` | `ActiveModel::Type::String` | ✗ | | - -#### Validations - -- **national_insurance_number** (`presence`): - #### Operations | Operation | Description | @@ -299,6 +295,18 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `appropriate_body_type` | `ActiveModel::Type::String` | ✗ | | +| `independent_appropriate_body_name` | `ActiveModel::Type::String` | ✗ | | + +#### Validations + +- **appropriate_body_type** (`presence`): +- **independent_appropriate_body_name** (`presence`): + #### Operations | Operation | Description | @@ -379,6 +387,16 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `lead_provider_id` | `ActiveModel::Type::String` | ✗ | | + +#### Validations + +- **lead_provider_id** (`presence`): + #### Operations | Operation | Description | @@ -399,6 +417,16 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `national_insurance_number` | `ActiveModel::Type::String` | ✗ | | + +#### Validations + +- **national_insurance_number** (`presence`): + #### Operations | Operation | Description | @@ -439,6 +467,16 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `training_programme` | `ActiveModel::Type::String` | ✗ | | + +#### Validations + +- **training_programme** (`presence`): + #### Operations | Operation | Description | @@ -491,6 +529,16 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `start_date` | `ActiveModel::Type::Date` | ✗ | | + +#### Validations + +- **start_date** (`presence`): + #### Operations | Operation | Description | @@ -541,6 +589,16 @@ this step's purpose, user interactions, and business logic. Placeholder for step description. Add contextual information about this step's purpose, user interactions, and business logic. +#### Attributes + +| Attribute | Type | Required | Description | +|-----------|------|:--------:|-------------| +| `working_pattern` | `ActiveModel::Type::String` | ✗ | | + +#### Validations + +- **working_pattern** (`presence`): + #### Operations | Operation | Description | @@ -747,7 +805,12 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :check_answers: { :class: "Steps::RegisterECT::CheckAnswersStep", :label: "Check Answers", - :attributes: [], + :attributes: [ + { + :name: "confirm", + :type: "ActiveModel::Type::String" + } + ], :validators: [], :operations: [ { @@ -845,20 +908,8 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :trn_not_found: { :class: "Steps::RegisterECT::TRNNotFoundStep", :label: "Trn Not Found", - :attributes: [ - { - :name: "national_insurance_number", - :type: "ActiveModel::Type::String" - } - ], - :validators: [ - { - :name: "national_insurance_number", - :class: "ActiveModel::Validations::PresenceValidator", - :type: "presence", - :message: null - } - ], + :attributes: [], + :validators: [], :operations: [ { :name: "validate", @@ -889,8 +940,30 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :independent_school_appropriate_body: { :class: "Steps::RegisterECT::IndependentSchoolAppropriateBodyStep", :label: "Independent School Appropriate Body", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "appropriate_body_type", + :type: "ActiveModel::Type::String" + }, + { + :name: "independent_appropriate_body_name", + :type: "ActiveModel::Type::String" + } + ], + :validators: [ + { + :name: "appropriate_body_type", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + }, + { + :name: "independent_appropriate_body_name", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", @@ -953,8 +1026,20 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :lead_provider: { :class: "Steps::RegisterECT::LeadProviderStep", :label: "Lead Provider", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "lead_provider_id", + :type: "ActiveModel::Type::String" + } + ], + :validators: [ + { + :name: "lead_provider_id", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", @@ -969,8 +1054,20 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :national_insurance_number: { :class: "Steps::RegisterECT::NationalInsuranceNumberStep", :label: "National Insurance Number", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "national_insurance_number", + :type: "ActiveModel::Type::String" + } + ], + :validators: [ + { + :name: "national_insurance_number", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", @@ -1001,8 +1098,20 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :programme_type: { :class: "Steps::RegisterECT::ProgrammeTypeStep", :label: "Programme Type", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "training_programme", + :type: "ActiveModel::Type::String" + } + ], + :validators: [ + { + :name: "training_programme", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", @@ -1055,8 +1164,20 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :start_date: { :class: "Steps::RegisterECT::StartDateStep", :label: "Start Date", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "start_date", + :type: "ActiveModel::Type::Date" + } + ], + :validators: [ + { + :name: "start_date", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", @@ -1099,8 +1220,20 @@ Custom branching uses a method to evaluate complex logic and route to multiple p :working_pattern: { :class: "Steps::RegisterECT::WorkingPatternStep", :label: "Working Pattern", - :attributes: [], - :validators: [], + :attributes: [ + { + :name: "working_pattern", + :type: "ActiveModel::Type::String" + } + ], + :validators: [ + { + :name: "working_pattern", + :class: "ActiveModel::Validations::PresenceValidator", + :type: "presence", + :message: null + } + ], :operations: [ { :name: "validate", diff --git a/spec/rails-dummy/lib/tasks/wizard_documentation.rake b/spec/rails-dummy/lib/tasks/wizard_documentation.rake index d961eb8..31a9856 100644 --- a/spec/rails-dummy/lib/tasks/wizard_documentation.rake +++ b/spec/rails-dummy/lib/tasks/wizard_documentation.rake @@ -20,7 +20,6 @@ namespace :wizard do AssignMentorWizard, ALevelsRequirementsWizard, AddCourseWizard, - ApplyTeacherTrainingWizard, RegisterECTWizard, ].each do |wizard_class| wizard = wizard_class.new(state_store: OpenStruct.new) diff --git a/spec/rails-dummy/public/doc/wizards/AssignMentorWizard.svg b/spec/rails-dummy/public/doc/wizards/AssignMentorWizard.svg new file mode 100644 index 0000000..2874b89 --- /dev/null +++ b/spec/rails-dummy/public/doc/wizards/AssignMentorWizard.svg @@ -0,0 +1,65 @@ + + + + + + +Assign_mentor_wizard + + + +who_will_be_the_mentor + +Who Will Be The Mentor + + + +can_receive_mentor_training + +Can Receive Mentor Training + + + +who_will_be_the_mentor->can_receive_mentor_training + + + + + +which_lead_provider + +Which Lead Provider + + + +can_receive_mentor_training->which_lead_provider + + +LP provides? +yes + + + +confirmation + +Confirmation + + + +can_receive_mentor_training->confirmation + + +LP provides? +no + + + +which_lead_provider->confirmation + + + + + diff --git a/spec/rails-dummy/public/doc/wizards/RegisterECTWizard.svg b/spec/rails-dummy/public/doc/wizards/RegisterECTWizard.svg new file mode 100644 index 0000000..9e2c6ec --- /dev/null +++ b/spec/rails-dummy/public/doc/wizards/RegisterECTWizard.svg @@ -0,0 +1,294 @@ + + + + + + +Register_ECT_wizard + + + +cannot_register_ect + +Cannot Register Ect + + + +cant_use_email + +Cant Use Email + + + +check_answers + +Check Answers + + + +confirmation + +Confirmation + + + +check_answers->confirmation + + + + + +email_address + +Email Address + + + +email_address->cant_use_email + + +condition +yes + + + +start_date + +Start Date + + + +email_address->start_date + + +condition +no + + + +find_ect + +Find Ect + + + +find_ect->cannot_register_ect + + +Can not register ECT + + + +trn_not_found + +Trn Not Found + + + +find_ect->trn_not_found + + +TRN not found + + + +already_active_at_school + +Already Active At School + + + +find_ect->already_active_at_school + + +Already active at school + + + +induction_completed + +Induction Completed + + + +find_ect->induction_completed + + +Induction completed + + + +induction_exempt + +Induction Exempt + + + +find_ect->induction_exempt + + +Induction exempt + + + +national_insurance_number + +National Insurance Number + + + +find_ect->national_insurance_number + + +National Insurance number + + + +review_ect_details + +Review Ect Details + + + +find_ect->review_ect_details + + +Review ECT details + + + +independent_school_appropriate_body + +Independent School Appropriate Body + + + +programme_type + +Programme Type + + + +independent_school_appropriate_body->programme_type + + + + + +induction_failed + +Induction Failed + + + +lead_provider + +Lead Provider + + + +lead_provider->check_answers + + + + + +national_insurance_number->induction_completed + + +Induction completed? + + + +national_insurance_number->induction_exempt + + +Induction exempt + + + +not_found + +Not Found + + + +national_insurance_number->not_found + + +In TRS? + + + +national_insurance_number->review_ect_details + + +Review ECT details + + + +programme_type->check_answers + + +condition +no + + + +programme_type->lead_provider + + +condition +yes + + + +review_ect_details->email_address + + + + + +working_pattern + +Working Pattern + + + +start_date->working_pattern + + + + + +state_school_appropriate_body + +State School Appropriate Body + + + +state_school_appropriate_body->programme_type + + + + + +working_pattern->independent_school_appropriate_body + + +condition +yes + + + +working_pattern->state_school_appropriate_body + + +condition +no + + +