From ad5ea08088e0d41b261d89abbd72ebd73a0028dc Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Thu, 21 Nov 2024 15:59:32 +0000 Subject: [PATCH] Use LUP policy date range for lup claims LUP will extend past ECP, so we can't use the combined end date when deciding what subjects to show for nqts who haven't entered an itt, otherwise we render an empty list on the itt subject screen. --- app/models/journeys/additional_payments_for_teaching.rb | 2 +- app/models/policies/levelling_up_premium_payments.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/journeys/additional_payments_for_teaching.rb b/app/models/journeys/additional_payments_for_teaching.rb index b471564547..3b5ad6b6a3 100644 --- a/app/models/journeys/additional_payments_for_teaching.rb +++ b/app/models/journeys/additional_payments_for_teaching.rb @@ -54,7 +54,7 @@ def selectable_subject_symbols(journey_session) itt_year: journey_session.answers.itt_academic_year ) end.flatten.uniq - elsif journey_session.answers.policy_year.in?(EligibilityCheckable::COMBINED_ECP_AND_LUP_POLICY_YEARS_BEFORE_FINAL_YEAR) + elsif journey_session.answers.policy_year.in?(Policies::LevellingUpPremiumPayments::POLICY_RANGE) # they get the standard, unchanging LUP subject set because they won't have qualified in time for ECP by 2022/2023 # and they won't have given an ITT year Policies::LevellingUpPremiumPayments.fixed_subject_symbols diff --git a/app/models/policies/levelling_up_premium_payments.rb b/app/models/policies/levelling_up_premium_payments.rb index d7cec6ec7d..9a3ab6331e 100644 --- a/app/models/policies/levelling_up_premium_payments.rb +++ b/app/models/policies/levelling_up_premium_payments.rb @@ -28,6 +28,7 @@ module LevellingUpPremiumPayments POLICY_START_YEAR = AcademicYear.new(2022).freeze POLICY_END_YEAR = AcademicYear.new(2025).freeze + POLICY_RANGE = POLICY_START_YEAR..POLICY_END_YEAR # Percentage of claims to QA MIN_QA_THRESHOLD = 10 @@ -131,7 +132,7 @@ def fixed_subject_symbols end def subject_symbols(claim_year:, itt_year:) - return [] unless (POLICY_START_YEAR..POLICY_END_YEAR).cover?(claim_year) + return [] unless POLICY_RANGE.cover?(claim_year) previous_five_years = (claim_year - 5)...claim_year