Skip to content

Commit

Permalink
Remove more branches from trainee journey
Browse files Browse the repository at this point in the history
Removes the ineligiblity branches from the special case trainee teacher
journey. We want all eligibility checking to happen in one place (the
policy eligibility checker). This commit updates the mini trainee
journey to not check eligibility. This also surfaced a bug in the policy
eligiblity checker, a trainee teacher with an ineligible itt subject is
not yet ineligible, they may still be eligible later, we don't know
until they've entered their degree subject (at least according to the
logic in
`spec/features/trainee_teacher_subjourney_for_lup_schools_spec.rb:59`)
  • Loading branch information
rjlynch committed Dec 11, 2024
1 parent 6ec0f04 commit f93f6f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 4 additions & 8 deletions app/models/journeys/page_sequence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def slugs
end

def next_slug
return "ineligible" if journey_ineligible?

if lup_policy_and_trainee_teacher_at_lup_school?
return handle_trainee_teacher
end

return "ineligible" if journey_ineligible?

if claim_submittable?
return "student-loan-amount" if updating_personal_details? && in_sequence?("student-loan-amount")
return "check-your-answers"
Expand Down Expand Up @@ -98,19 +98,15 @@ def lup_trainee_at_lup_school
def handle_trainee_teacher
case current_slug
when "nqt-in-academic-year-after-itt"
@journey_session.answers.policy_year.in?(EligibilityCheckable::COMBINED_ECP_AND_LUP_POLICY_YEARS_BEFORE_FINAL_YEAR) ? "eligible-itt-subject" : "ineligible"
"eligible-itt-subject"
when "eligible-itt-subject"
if answers.eligible_itt_subject.to_sym.in? Policies::LevellingUpPremiumPayments.fixed_subject_symbols
"future-eligibility"
else
"eligible-degree-subject"
end
when "eligible-degree-subject"
if @journey_session.answers.eligible_degree_subject?
"future-eligibility"
else
"ineligible"
end
"future-eligibility"
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ def eligible_degree?
end

def specific_ineligible_attributes?
indicated_ecp_only_itt_subject? || trainee_teacher_with_ineligible_itt_subject? || ineligible_itt_subject_and_no_relevant_degree?
end

def trainee_teacher_with_ineligible_itt_subject?
trainee_teacher? && indicated_ineligible_itt_subject?
indicated_ecp_only_itt_subject? || ineligible_itt_subject_and_no_relevant_degree?
end

def ineligible_itt_subject_and_no_relevant_degree?
Expand Down

0 comments on commit f93f6f6

Please sign in to comment.