Skip to content

Commit

Permalink
remove most of JobApplicationStepProcess apart from the step groups
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Jan 15, 2025
1 parent 5af0aef commit a574428
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class Jobseekers::JobApplications::BaseController < Jobseekers::BaseController

def step_process
Jobseekers::JobApplications::JobApplicationStepProcess.new(
current_step || :review,
job_application: job_application,
)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
class Jobseekers::JobApplications::JobApplicationStepProcess < StepProcess
attr_reader :job_application
module Jobseekers
module JobApplications
class JobApplicationStepProcess
def initialize(job_application:)
@job_application = job_application

def initialize(current_step, job_application:)
@job_application = job_application
@step_groups = {
personal_details: %i[personal_details],
professional_status: %i[professional_status],
qualifications: %i[qualifications],
training_and_cpds: %i[training_and_cpds],
employment_history: %i[employment_history],
personal_statement: %i[personal_statement],
references: %i[references],
equal_opportunities: %i[equal_opportunities],
ask_for_support: %i[ask_for_support],
declarations: %i[declarations],
review: %i[review],
}
end

super(current_step, {
personal_details: %i[personal_details],
professional_status: %i[professional_status],
qualifications: %i[qualifications],
training_and_cpds: %i[training_and_cpds],
employment_history: %i[employment_history],
personal_statement: %i[personal_statement],
references: %i[references],
equal_opportunities: %i[equal_opportunities],
ask_for_support: %i[ask_for_support],
declarations: %i[declarations],
review: %i[review],
})
# Returns the keys of all individual steps in order
def steps
@step_groups.values.flatten
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def relevant_steps
# The step process is needed in order to filter out the steps that are not relevant to the new job application,
# for eg. professional status - see https://github.com/DFE-Digital/teaching-vacancies/blob/75cec792d9e229fb866bdafc017f82501bd01001/app/services/jobseekers/job_applications/job_application_step_process.rb#L23
# The review step is used as a current step is required.
Jobseekers::JobApplications::JobApplicationStepProcess.new(:review, job_application: new_job_application).steps
Jobseekers::JobApplications::JobApplicationStepProcess.new(job_application: new_job_application).steps
end

def completed_steps
Expand Down

This file was deleted.

0 comments on commit a574428

Please sign in to comment.