Skip to content

Commit

Permalink
Use POLICY_END_YEAR
Browse files Browse the repository at this point in the history
FINAL_LUP_POLICY_YEAR is a dupe of Lup::POLICY_END_YEAR. We should have
updated Lup::POLICY_END_YEAR to 2025 as part of capt-1832
  • Loading branch information
rjlynch committed Dec 11, 2024
1 parent 2cf0f5e commit ac18ee7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/models/concerns/eligibility_checkable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module EligibilityCheckable

FIRST_COMBINED_ECP_AND_LUP_POLICY_YEAR = AcademicYear.new(2022)
FINAL_COMBINED_ECP_AND_LUP_POLICY_YEAR = AcademicYear.new(2024)
FINAL_LUP_POLICY_YEAR = AcademicYear.new(2025)
COMBINED_ECP_AND_LUP_POLICY_YEARS = FIRST_COMBINED_ECP_AND_LUP_POLICY_YEAR..FINAL_COMBINED_ECP_AND_LUP_POLICY_YEAR
COMBINED_ECP_AND_LUP_POLICY_YEARS_BEFORE_FINAL_YEAR = FIRST_COMBINED_ECP_AND_LUP_POLICY_YEAR...FINAL_COMBINED_ECP_AND_LUP_POLICY_YEAR

Expand Down
9 changes: 1 addition & 8 deletions app/models/journeys/additional_payments_for_teaching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ module AdditionalPaymentsForTeaching
}
}.freeze

def final_policy_year(policy)
{
Policies::EarlyCareerPayments => EligibilityCheckable::FINAL_COMBINED_ECP_AND_LUP_POLICY_YEAR,
Policies::LevellingUpPremiumPayments => EligibilityCheckable::FINAL_LUP_POLICY_YEAR
}[policy]
end

def set_a_reminder?(itt_academic_year:, policy:)
policy_year = configuration.current_academic_year
return false if policy_year >= final_policy_year(policy)
return false if policy_year >= policy::POLICY_END_YEAR

next_year = policy_year + 1
eligible_itt_years = JourneySubjectEligibilityChecker.selectable_itt_years_for_claim_year(next_year)
Expand Down
2 changes: 1 addition & 1 deletion app/models/policies/levelling_up_premium_payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module LevellingUpPremiumPayments
SEARCHABLE_ELIGIBILITY_ATTRIBUTES = %w[teacher_reference_number].freeze

POLICY_START_YEAR = AcademicYear.new(2022).freeze
POLICY_END_YEAR = AcademicYear.new(2024).freeze
POLICY_END_YEAR = AcademicYear.new(2025).freeze

# Percentage of claims to QA
MIN_QA_THRESHOLD = 10
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/ineligibility_reason_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
:additional_payments_answers,
:ecp_and_lup_eligible,
:trainee_teacher,
academic_year: AcademicYear.new(2024),
academic_year: AcademicYear.new(2025),
current_school_id: school.id
)
end
Expand Down

0 comments on commit ac18ee7

Please sign in to comment.