From a043484c6db92055158b5bc99cb6aa65e1835532 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 21 Feb 2024 12:48:16 +0000 Subject: [PATCH] Update question numbers for 2024 lettings --- app/models/form/lettings/questions/address_line1.rb | 4 +++- app/models/form/lettings/questions/age.rb | 10 +++++++++- app/models/form/lettings/questions/age1.rb | 4 +++- app/models/form/lettings/questions/age1_known.rb | 4 +++- app/models/form/lettings/questions/age_known.rb | 6 +++++- app/models/form/lettings/questions/armedforces.rb | 4 +++- app/models/form/lettings/questions/beds.rb | 4 +++- app/models/form/lettings/questions/benefits.rb | 4 +++- app/models/form/lettings/questions/brent_4_weekly.rb | 4 +++- app/models/form/lettings/questions/brent_bi_weekly.rb | 4 +++- app/models/form/lettings/questions/brent_monthly.rb | 4 +++- app/models/form/lettings/questions/brent_weekly.rb | 4 +++- app/models/form/lettings/questions/builtype.rb | 4 +++- .../form/lettings/questions/chcharge_4_weekly.rb | 4 +++- .../form/lettings/questions/chcharge_bi_weekly.rb | 4 +++- app/models/form/lettings/questions/chcharge_monthly.rb | 4 +++- app/models/form/lettings/questions/chcharge_weekly.rb | 4 +++- .../form/lettings/questions/condition_effects.rb | 4 +++- app/models/form/lettings/questions/county.rb | 4 +++- app/models/form/lettings/questions/declaration.rb | 4 +++- app/models/form/lettings/questions/earnings.rb | 4 +++- app/models/form/lettings/questions/ethnic_arab.rb | 4 +++- app/models/form/lettings/questions/ethnic_asian.rb | 4 +++- app/models/form/lettings/questions/ethnic_black.rb | 4 +++- app/models/form/lettings/questions/ethnic_group.rb | 4 +++- app/models/form/lettings/questions/ethnic_mixed.rb | 4 +++- app/models/form/lettings/questions/ethnic_white.rb | 4 +++- .../first_time_property_let_as_social_housing.rb | 4 +++- app/models/form/lettings/questions/gender_identity1.rb | 4 +++- app/models/form/lettings/questions/hb.rb | 4 +++- app/models/form/lettings/questions/hbrentshortfall.rb | 4 +++- app/models/form/lettings/questions/hhmemb.rb | 4 +++- app/models/form/lettings/questions/homeless.rb | 4 +++- app/models/form/lettings/questions/household_charge.rb | 4 +++- app/models/form/lettings/questions/housingneeds.rb | 4 +++- .../form/lettings/questions/housingneeds_other.rb | 4 +++- .../form/lettings/questions/housingneeds_type.rb | 4 +++- app/models/form/lettings/questions/illness.rb | 4 +++- app/models/form/lettings/questions/incfreq.rb | 4 +++- app/models/form/lettings/questions/irproduct_other.rb | 4 +++- app/models/form/lettings/questions/is_carehome.rb | 4 +++- app/models/form/lettings/questions/joint.rb | 4 +++- app/models/form/lettings/questions/la.rb | 4 +++- app/models/form/lettings/questions/layear.rb | 4 +++- app/models/form/lettings/questions/leftreg.rb | 4 +++- .../form/lettings/questions/letting_allocation.rb | 4 +++- app/models/form/lettings/questions/location_id.rb | 4 +++- app/models/form/lettings/questions/majorrepairs.rb | 4 +++- .../form/lettings/questions/managing_organisation.rb | 4 +++- app/models/form/lettings/questions/mrcdate.rb | 4 +++- app/models/form/lettings/questions/nationality.rb | 4 +++- app/models/form/lettings/questions/nationality_all.rb | 4 +++- .../form/lettings/questions/nationality_all_group.rb | 4 +++- app/models/form/lettings/questions/needs_type.rb | 4 +++- app/models/form/lettings/questions/net_income_known.rb | 4 +++- app/models/form/lettings/questions/offered.rb | 4 +++- app/models/form/lettings/questions/period.rb | 4 +++- .../form/lettings/questions/person_gender_identity.rb | 10 +++++++++- .../form/lettings/questions/person_relationship.rb | 10 +++++++++- .../lettings/questions/person_working_situation.rb | 10 +++++++++- .../lettings/questions/postcode_for_full_address.rb | 4 +++- app/models/form/lettings/questions/ppcodenk.rb | 4 +++- app/models/form/lettings/questions/ppostcode_full.rb | 4 +++- app/models/form/lettings/questions/preg_occ.rb | 4 +++- .../form/lettings/questions/previous_la_known.rb | 4 +++- .../form/lettings/questions/previous_let_type.rb | 4 +++- app/models/form/lettings/questions/previous_tenure.rb | 4 +++- .../form/lettings/questions/previous_tenure_renewal.rb | 4 +++- app/models/form/lettings/questions/prevloc.rb | 4 +++- .../form/lettings/questions/property_reference.rb | 4 +++- .../form/lettings/questions/pscharge_4_weekly.rb | 4 +++- .../form/lettings/questions/pscharge_bi_weekly.rb | 4 +++- app/models/form/lettings/questions/pscharge_monthly.rb | 4 +++- app/models/form/lettings/questions/pscharge_weekly.rb | 4 +++- app/models/form/lettings/questions/reason.rb | 4 +++- app/models/form/lettings/questions/reason_renewal.rb | 4 +++- .../lettings/questions/reasonable_preference_reason.rb | 4 +++- app/models/form/lettings/questions/reasonother.rb | 4 +++- app/models/form/lettings/questions/reasonpref.rb | 4 +++- app/models/form/lettings/questions/referral.rb | 4 +++- app/models/form/lettings/questions/referral_prp.rb | 4 +++- .../lettings/questions/referral_supported_housing.rb | 4 +++- .../questions/referral_supported_housing_prp.rb | 4 +++- app/models/form/lettings/questions/renewal.rb | 4 +++- app/models/form/lettings/questions/rent_type.rb | 4 +++- app/models/form/lettings/questions/reservist.rb | 4 +++- app/models/form/lettings/questions/rsnvac.rb | 4 +++- app/models/form/lettings/questions/rsnvac_first_let.rb | 4 +++- app/models/form/lettings/questions/scharge_4_weekly.rb | 4 +++- .../form/lettings/questions/scharge_bi_weekly.rb | 4 +++- app/models/form/lettings/questions/scharge_monthly.rb | 4 +++- app/models/form/lettings/questions/scharge_weekly.rb | 4 +++- app/models/form/lettings/questions/scheme_id.rb | 4 +++- app/models/form/lettings/questions/sheltered.rb | 4 +++- .../form/lettings/questions/starter_tenancy_type.rb | 4 +++- app/models/form/lettings/questions/startertenancy.rb | 4 +++- app/models/form/lettings/questions/stock_owner.rb | 4 +++- .../form/lettings/questions/supcharg_4_weekly.rb | 4 +++- .../form/lettings/questions/supcharg_bi_weekly.rb | 4 +++- app/models/form/lettings/questions/supcharg_monthly.rb | 4 +++- app/models/form/lettings/questions/supcharg_weekly.rb | 4 +++- app/models/form/lettings/questions/tenancy_length.rb | 4 +++- .../questions/tenancy_length_affordable_rent.rb | 4 +++- .../questions/tenancy_length_intermediate_rent.rb | 4 +++- .../form/lettings/questions/tenancy_length_periodic.rb | 4 +++- app/models/form/lettings/questions/tenancy_other.rb | 4 +++- .../form/lettings/questions/tenancy_start_date.rb | 4 +++- app/models/form/lettings/questions/tenancy_type.rb | 4 +++- app/models/form/lettings/questions/tenant_code.rb | 4 +++- app/models/form/lettings/questions/town_or_city.rb | 4 +++- app/models/form/lettings/questions/tshortfall.rb | 4 +++- app/models/form/lettings/questions/tshortfall_known.rb | 4 +++- app/models/form/lettings/questions/unittype_gn.rb | 4 +++- app/models/form/lettings/questions/uprn.rb | 4 +++- app/models/form/lettings/questions/voiddate.rb | 4 +++- app/models/form/lettings/questions/waityear.rb | 4 +++- app/models/form/lettings/questions/wheelchair.rb | 4 +++- .../form/lettings/questions/working_situation1.rb | 4 +++- 118 files changed, 380 insertions(+), 118 deletions(-) diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index 95702b8de..1ee2a7b0b 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question @plain_label = true @check_answer_label = "Address lines 1 and 2" @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = 12 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @hide_question_number_on_page = true end @@ -18,4 +18,6 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question log.address_line2, ].select(&:present?).join("\n") end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb index 6b76a6945..5b6567450 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -12,6 +12,14 @@ class Form::Lettings::Questions::Age < ::Form::Question @min = 1 @step = 1 @hint_text = "For a child under 1, enter 1" if person_type == "child" - @question_number = 31 + (4 * person_index) + @person_index = person_index + end + + def question_number + if form.start_date.year == 2023 + 31 + (4 * @person_index) + else + 30 + (4 * @person_index) + end end end diff --git a/app/models/form/lettings/questions/age1.rb b/app/models/form/lettings/questions/age1.rb index 2f43ac7ab..3d3c1fb26 100644 --- a/app/models/form/lettings/questions/age1.rb +++ b/app/models/form/lettings/questions/age1.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::Age1 < ::Form::Question @max = 120 @min = 16 @step = 1 - @question_number = 32 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze end diff --git a/app/models/form/lettings/questions/age1_known.rb b/app/models/form/lettings/questions/age1_known.rb index 42505b113..21854219d 100644 --- a/app/models/form/lettings/questions/age1_known.rb +++ b/app/models/form/lettings/questions/age1_known.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "age1" => [0] } @hidden_in_check_answers = { "depends_on" => [{ "age1_known" => 0 }, { "age1_known" => 1 }] } - @question_number = 32 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze @@ -21,4 +21,6 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze end diff --git a/app/models/form/lettings/questions/age_known.rb b/app/models/form/lettings/questions/age_known.rb index 9f9264e7d..8c7be6631 100644 --- a/app/models/form/lettings/questions/age_known.rb +++ b/app/models/form/lettings/questions/age_known.rb @@ -15,8 +15,12 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question { "age#{person_index}_known" => 1 }, ], } - @question_number = 31 + (4 * person_index) + @person_index = person_index end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze + + def question_number + 31 + (4 * @person_index) + end end diff --git a/app/models/form/lettings/questions/armedforces.rb b/app/models/form/lettings/questions/armedforces.rb index fb9a02a64..233cf78d5 100644 --- a/app/models/form/lettings/questions/armedforces.rb +++ b/app/models/form/lettings/questions/armedforces.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question @check_answers_card_number = 0 @hint_text = "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." @answer_options = ANSWER_OPTIONS - @question_number = 66 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -20,4 +20,6 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question "3" => { "value" => "Person prefers not to say" }, "6" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 66, 2024 => 65 }.freeze end diff --git a/app/models/form/lettings/questions/beds.rb b/app/models/form/lettings/questions/beds.rb index e75e688bb..3275ac2dd 100644 --- a/app/models/form/lettings/questions/beds.rb +++ b/app/models/form/lettings/questions/beds.rb @@ -10,10 +10,12 @@ class Form::Lettings::Questions::Beds < ::Form::Question @max = 12 @min = 1 @step = 1 - @question_number = 22 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def hint_text form.start_year_after_2024? ? "If shared accommodation, enter the number of bedrooms occupied by this household." : "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom." end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze end diff --git a/app/models/form/lettings/questions/benefits.rb b/app/models/form/lettings/questions/benefits.rb index 3d23c50a1..7f265ff8f 100644 --- a/app/models/form/lettings/questions/benefits.rb +++ b/app/models/form/lettings/questions/benefits.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Benefits < ::Form::Question @check_answers_card_number = 0 @hint_text = "This excludes child and housing benefit, council tax support and tax credits." @answer_options = ANSWER_OPTIONS - @question_number = 90 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -18,4 +18,6 @@ class Form::Lettings::Questions::Benefits < ::Form::Question "divider" => { "value" => true }, "4" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 90, 2024 => 89 }.freeze end diff --git a/app/models/form/lettings/questions/brent_4_weekly.rb b/app/models/form/lettings/questions/brent_4_weekly.rb index 6649b9a60..199428559 100644 --- a/app/models/form/lettings/questions/brent_4_weekly.rb +++ b/app/models/form/lettings/questions/brent_4_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = 95 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/brent_bi_weekly.rb b/app/models/form/lettings/questions/brent_bi_weekly.rb index 37f1bfa20..fe5940953 100644 --- a/app/models/form/lettings/questions/brent_bi_weekly.rb +++ b/app/models/form/lettings/questions/brent_bi_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = 95 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb index e38a490b0..a1a3de9c8 100644 --- a/app/models/form/lettings/questions/brent_monthly.rb +++ b/app/models/form/lettings/questions/brent_monthly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = 95 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb index 7a8adfc7a..3bcbe22fd 100644 --- a/app/models/form/lettings/questions/brent_weekly.rb +++ b/app/models/form/lettings/questions/brent_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = 95 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb index 9cda5649f..6295ae16c 100644 --- a/app/models/form/lettings/questions/builtype.rb +++ b/app/models/form/lettings/questions/builtype.rb @@ -8,11 +8,13 @@ class Form::Lettings::Questions::Builtype < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 20 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "2" => { "value" => "Converted from previous residential or non-residential property" }, "1" => { "value" => "Purpose built" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 20 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_4_weekly.rb b/app/models/form/lettings/questions/chcharge_4_weekly.rb index 6e0923cc0..92fccfc6a 100644 --- a/app/models/form/lettings/questions/chcharge_4_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_4_weekly.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 4 weeks" - @question_number = 94 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_bi_weekly.rb b/app/models/form/lettings/questions/chcharge_bi_weekly.rb index 273ec7ac0..2999156ac 100644 --- a/app/models/form/lettings/questions/chcharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_bi_weekly.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 2 weeks" - @question_number = 94 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_monthly.rb b/app/models/form/lettings/questions/chcharge_monthly.rb index ab2da34ad..6097ad888 100644 --- a/app/models/form/lettings/questions/chcharge_monthly.rb +++ b/app/models/form/lettings/questions/chcharge_monthly.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every month" - @question_number = 94 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_weekly.rb b/app/models/form/lettings/questions/chcharge_weekly.rb index 96b8de324..069620936 100644 --- a/app/models/form/lettings/questions/chcharge_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_weekly.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every week" - @question_number = 94 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/condition_effects.rb b/app/models/form/lettings/questions/condition_effects.rb index c8240f232..5cf8dc9a6 100644 --- a/app/models/form/lettings/questions/condition_effects.rb +++ b/app/models/form/lettings/questions/condition_effects.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS - @question_number = 74 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -29,4 +29,6 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question "illness_type_1" => { "value" => "Vision", "hint" => "For example, blindness or partial sight." }, "illness_type_10" => { "value" => "Other" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 74, 2024 => 73 }.freeze end diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb index 8eaa410eb..8a00b5a8b 100644 --- a/app/models/form/lettings/questions/county.rb +++ b/app/models/form/lettings/questions/county.rb @@ -7,7 +7,9 @@ class Form::Lettings::Questions::County < ::Form::Question @plain_label = true @check_answer_label = "County" @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = 12 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @hide_question_number_on_page = true end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 985c4eed1..2d06fba9b 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question @type = "checkbox" @check_answers_card_number = 0 unless form.start_year_after_2024? @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant" - @question_number = 30 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -19,4 +19,6 @@ class Form::Lettings::Questions::Declaration < ::Form::Question { "declaration" => { "value" => declaration_text } }.freeze end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 30, 2024 => 11 }.freeze end diff --git a/app/models/form/lettings/questions/earnings.rb b/app/models/form/lettings/questions/earnings.rb index 84d9ff9c5..6ecc3dbc2 100644 --- a/app/models/form/lettings/questions/earnings.rb +++ b/app/models/form/lettings/questions/earnings.rb @@ -17,6 +17,8 @@ class Form::Lettings::Questions::Earnings < ::Form::Question { "label" => " every month", "depends_on" => { "incfreq" => 2 } }, { "label" => " every year", "depends_on" => { "incfreq" => 3 } }, ] - @question_number = 88 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 88, 2024 => 87 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb index 9884b69f0..b632e6a87 100644 --- a/app/models/form/lettings/questions/ethnic_arab.rb +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 35 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -19,4 +19,6 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question "value" => "Other ethnic group", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb index 17aa29d44..af0a48440 100644 --- a/app/models/form/lettings/questions/ethnic_asian.rb +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 35 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -28,4 +28,6 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question "value" => "Any other Asian or Asian British background", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb index 8ae04982f..e2b6e5cd8 100644 --- a/app/models/form/lettings/questions/ethnic_black.rb +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 35 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -22,4 +22,6 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question "value" => "Any other Black, African, Caribbean or Black British background", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_group.rb b/app/models/form/lettings/questions/ethnic_group.rb index f9e392089..5693d1bee 100644 --- a/app/models/form/lettings/questions/ethnic_group.rb +++ b/app/models/form/lettings/questions/ethnic_group.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 34 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -20,4 +20,6 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question "divider" => { "value" => true }, "17" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 34, 2024 => 33 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb index ac059837d..eb342f684 100644 --- a/app/models/form/lettings/questions/ethnic_mixed.rb +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 35 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -25,4 +25,6 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question "value" => "Any other Mixed or Multiple ethnic background", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 11bb3ef8a..7e3422b49 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question @type = "radio" @check_answers_card_number = 1 @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." - @question_number = 35 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -28,4 +28,6 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index 10fe5752d..20cc19dc4 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @question_number = 14 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -24,4 +24,6 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q def no_hint form.start_year_after_2024? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze end diff --git a/app/models/form/lettings/questions/gender_identity1.rb b/app/models/form/lettings/questions/gender_identity1.rb index f7bba8e89..3e667b58e 100644 --- a/app/models/form/lettings/questions/gender_identity1.rb +++ b/app/models/form/lettings/questions/gender_identity1.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = 33 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -25,4 +25,6 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze end diff --git a/app/models/form/lettings/questions/hb.rb b/app/models/form/lettings/questions/hb.rb index 11a9faa8e..3e85ac553 100644 --- a/app/models/form/lettings/questions/hb.rb +++ b/app/models/form/lettings/questions/hb.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Hb < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive." : "" @answer_options = ANSWER_OPTIONS - @question_number = 89 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -19,4 +19,6 @@ class Form::Lettings::Questions::Hb < ::Form::Question "3" => { "value" => "Don’t know" }, "10" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 88 }.freeze end diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb index 828c36377..c29803057 100644 --- a/app/models/form/lettings/questions/hbrentshortfall.rb +++ b/app/models/form/lettings/questions/hbrentshortfall.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question @check_answers_card_number = 0 @hint_text = "Also known as the ‘outstanding amount’." @answer_options = ANSWER_OPTIONS - @question_number = 99 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -16,4 +16,6 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question "2" => { "value" => "No" }, "3" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98 }.freeze end diff --git a/app/models/form/lettings/questions/hhmemb.rb b/app/models/form/lettings/questions/hhmemb.rb index fee0aced3..2803c74cc 100644 --- a/app/models/form/lettings/questions/hhmemb.rb +++ b/app/models/form/lettings/questions/hhmemb.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question @min = 1 @hint_text = "You can provide details for a maximum of 8 people." @step = 1 - @question_number = 31 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 30 }.freeze end diff --git a/app/models/form/lettings/questions/homeless.rb b/app/models/form/lettings/questions/homeless.rb index 2462f75ab..403ede2ab 100644 --- a/app/models/form/lettings/questions/homeless.rb +++ b/app/models/form/lettings/questions/homeless.rb @@ -8,11 +8,13 @@ class Form::Lettings::Questions::Homeless < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 79 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "11" => { "value" => "Yes - assessed by a local authority as homeless" }, "1" => { "value" => "No" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 79, 2024 => 78 }.freeze end diff --git a/app/models/form/lettings/questions/household_charge.rb b/app/models/form/lettings/questions/household_charge.rb index da77cb361..405f9b531 100644 --- a/app/models/form/lettings/questions/household_charge.rb +++ b/app/models/form/lettings/questions/household_charge.rb @@ -8,8 +8,10 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question @check_answers_card_number = 0 @hint_text = "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves." @answer_options = ANSWER_OPTIONS - @question_number = 91 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 91, 2024 => 90 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds.rb b/app/models/form/lettings/questions/housingneeds.rb index 5b6775eec..d5647e699 100644 --- a/app/models/form/lettings/questions/housingneeds.rb +++ b/app/models/form/lettings/questions/housingneeds.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 70 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 70, 2024 => 69 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index 754fb106c..13b6e9f03 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @question_number = 72 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -24,4 +24,6 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 72, 2024 => 71 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds_type.rb b/app/models/form/lettings/questions/housingneeds_type.rb index 49a03e73d..2f0badfaf 100644 --- a/app/models/form/lettings/questions/housingneeds_type.rb +++ b/app/models/form/lettings/questions/housingneeds_type.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 71 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -18,4 +18,6 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "None of the listed options" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 71, 2024 => 70 }.freeze end diff --git a/app/models/form/lettings/questions/illness.rb b/app/models/form/lettings/questions/illness.rb index 6a54c6a46..cb1609333 100644 --- a/app/models/form/lettings/questions/illness.rb +++ b/app/models/form/lettings/questions/illness.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Illness < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 73 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Illness < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 73, 2024 => 72 }.freeze end diff --git a/app/models/form/lettings/questions/incfreq.rb b/app/models/form/lettings/questions/incfreq.rb index c31f23fd5..9aab7650e 100644 --- a/app/models/form/lettings/questions/incfreq.rb +++ b/app/models/form/lettings/questions/incfreq.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question @hint_text = "" @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = true - @question_number = 87 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question "2" => { "value" => "Monthly" }, "3" => { "value" => "Yearly" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 87, 2024 => 86 }.freeze end diff --git a/app/models/form/lettings/questions/irproduct_other.rb b/app/models/form/lettings/questions/irproduct_other.rb index be21c3d27..a3718d58f 100644 --- a/app/models/form/lettings/questions/irproduct_other.rb +++ b/app/models/form/lettings/questions/irproduct_other.rb @@ -5,6 +5,8 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question @check_answer_label = "Product name" @header = "Name of rent product" @type = "text" - @question_number = 6 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 6 }.freeze end diff --git a/app/models/form/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb index 34c40db50..b9ba3d35f 100644 --- a/app/models/form/lettings/questions/is_carehome.rb +++ b/app/models/form/lettings/questions/is_carehome.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @conditional_for = { "chcharge" => [1] } - @question_number = 93 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -24,4 +24,6 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 93, 2024 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index 538660cdb..f745d6210 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Joint < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "This is where two or more people are named on the tenancy agreement" : "" @answer_options = ANSWER_OPTIONS - @question_number = 25 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Joint < ::Form::Question "divider" => { "value" => "true" }, "3" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 25 }.freeze end diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index f9d650918..999bb5db6 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -7,11 +7,13 @@ class Form::Lettings::Questions::La < ::Form::Question @type = "select" @check_answers_card_number = nil @hint_text = "" - @question_number = 13 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end def answer_options { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).england.map { |la| [la.code, la.name] }.to_h) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14 }.freeze end diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb index ad504589b..97363ae16 100644 --- a/app/models/form/lettings/questions/layear.rb +++ b/app/models/form/lettings/questions/layear.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @question_number = 75 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -38,4 +38,6 @@ class Form::Lettings::Questions::Layear < ::Form::Question } end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 75, 2024 => 74 }.freeze end diff --git a/app/models/form/lettings/questions/leftreg.rb b/app/models/form/lettings/questions/leftreg.rb index 98c6064ac..29fd0b401 100644 --- a/app/models/form/lettings/questions/leftreg.rb +++ b/app/models/form/lettings/questions/leftreg.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 67 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -18,4 +18,6 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Person prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 66 }.freeze end diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb index 09fd82121..2db5f7d36 100644 --- a/app/models/form/lettings/questions/letting_allocation.rb +++ b/app/models/form/lettings/questions/letting_allocation.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question @type = "checkbox" @check_answers_card_number = 0 @hint_text = "Select all that apply." - @question_number = 84 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -30,4 +30,6 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 84, 2024 => 83 }.freeze end diff --git a/app/models/form/lettings/questions/location_id.rb b/app/models/form/lettings/questions/location_id.rb index 62ee0d218..c79065273 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/app/models/form/lettings/questions/location_id.rb @@ -11,7 +11,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question "needstype": 2, }, } - @question_number = 10 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? @disable_clearing_if_not_routed_or_dynamic_answer_options = true @top_guidance_partial = "finding_location" end @@ -58,4 +58,6 @@ private "Which location is this log for?" end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze end diff --git a/app/models/form/lettings/questions/majorrepairs.rb b/app/models/form/lettings/questions/majorrepairs.rb index 83acf76a6..f935d377c 100644 --- a/app/models/form/lettings/questions/majorrepairs.rb +++ b/app/models/form/lettings/questions/majorrepairs.rb @@ -9,8 +9,10 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question @hint_text = "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs." @answer_options = ANSWER_OPTIONS @conditional_for = { "mrcdate" => [1] } - @question_number = 24 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 24 }.freeze end diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index 55a38ee71..2cfcedbbf 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question @check_answer_label = "Managing agent" @header = "Which organisation manages this letting?" @type = "select" - @question_number = 2 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end def answer_options(log = nil, user = nil) @@ -83,4 +83,6 @@ private def selected_answer_option_is_derived?(_log) true end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 2 }.freeze end diff --git a/app/models/form/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb index 09176dca6..75dde5ac4 100644 --- a/app/models/form/lettings/questions/mrcdate.rb +++ b/app/models/form/lettings/questions/mrcdate.rb @@ -6,6 +6,8 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question @header = "When were the repairs completed?" @type = "date" @check_answers_card_number = 0 - @question_number = 24 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 24 }.freeze end diff --git a/app/models/form/lettings/questions/nationality.rb b/app/models/form/lettings/questions/nationality.rb index c86f93b09..d4713e60b 100644 --- a/app/models/form/lettings/questions/nationality.rb +++ b/app/models/form/lettings/questions/nationality.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Nationality < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 36 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -21,4 +21,6 @@ class Form::Lettings::Questions::Nationality < ::Form::Question "divider" => true, "13" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze end diff --git a/app/models/form/lettings/questions/nationality_all.rb b/app/models/form/lettings/questions/nationality_all.rb index 354622f2f..d8afc5a16 100644 --- a/app/models/form/lettings/questions/nationality_all.rb +++ b/app/models/form/lettings/questions/nationality_all.rb @@ -7,10 +7,12 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question @type = "select" @check_answers_card_number = 1 @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS - @question_number = 36 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_label(log, _current_user = nil) answer_options[log.nationality_all.to_s]["name"] end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze end diff --git a/app/models/form/lettings/questions/nationality_all_group.rb b/app/models/form/lettings/questions/nationality_all_group.rb index 49b000a16..7d1b39a45 100644 --- a/app/models/form/lettings/questions/nationality_all_group.rb +++ b/app/models/form/lettings/questions/nationality_all_group.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest. If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." @answer_options = ANSWER_OPTIONS - @question_number = 36 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @conditional_for = { "nationality_all" => [12] } @hidden_in_check_answers = { "depends_on" => [{ "nationality_all_group" => 12 }] } end @@ -18,4 +18,6 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question "12" => { "value" => "Other" }, "0" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze end diff --git a/app/models/form/lettings/questions/needs_type.rb b/app/models/form/lettings/questions/needs_type.rb index eaa13cb9d..81fc1f172 100644 --- a/app/models/form/lettings/questions/needs_type.rb +++ b/app/models/form/lettings/questions/needs_type.rb @@ -7,11 +7,13 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question @hint_text = "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = 3 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end ANSWER_OPTIONS = { "1" => { "value" => "General needs" }, "2" => { "value" => "Supported housing" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 3 }.freeze end diff --git a/app/models/form/lettings/questions/net_income_known.rb b/app/models/form/lettings/questions/net_income_known.rb index d3008f44f..558e24155 100644 --- a/app/models/form/lettings/questions/net_income_known.rb +++ b/app/models/form/lettings/questions/net_income_known.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question @top_guidance_partial = "what_counts_as_income" @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 86 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -18,4 +18,6 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question "divider_a" => { "value" => true }, "2" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 86, 2024 => 85 }.freeze end diff --git a/app/models/form/lettings/questions/offered.rb b/app/models/form/lettings/questions/offered.rb index e41def301..e5ccf59cf 100644 --- a/app/models/form/lettings/questions/offered.rb +++ b/app/models/form/lettings/questions/offered.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::Offered < ::Form::Question @min = 0 @hint_text = I18n.t("hints.offered") @step = 1 - @question_number = 18 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/period.rb b/app/models/form/lettings/questions/period.rb index c9fa80263..ff265f4f8 100644 --- a/app/models/form/lettings/questions/period.rb +++ b/app/models/form/lettings/questions/period.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Period < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select how often the household is charged. This may be different to how often they pay." @answer_options = ANSWER_OPTIONS - @question_number = 92 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -23,4 +23,6 @@ class Form::Lettings::Questions::Period < ::Form::Question "1" => { "value" => "Weekly for 52 weeks" }, "10" => { "value" => "Weekly for 53 weeks" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 92, 2024 => 91 }.freeze end diff --git a/app/models/form/lettings/questions/person_gender_identity.rb b/app/models/form/lettings/questions/person_gender_identity.rb index 657438071..87a76f0b1 100644 --- a/app/models/form/lettings/questions/person_gender_identity.rb +++ b/app/models/form/lettings/questions/person_gender_identity.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question @type = "radio" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS - @question_number = 32 + (4 * person_index) + @person_index = person_index end ANSWER_OPTIONS = { @@ -25,4 +25,12 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question "" end end + + def question_number + if form.start_date.year == 2023 + 32 + (4 * @person_index) + else + 31 + (4 * @person_index) + end + end end diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index 0d54db949..dcedd7125 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question @check_answers_card_number = person_index @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 30 + (4 * person_index) + @person_index = person_index end ANSWER_OPTIONS = { @@ -21,4 +21,12 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question "divider" => { "value" => true }, "R" => { "value" => "Person prefers not to say" }, }.freeze + + def question_number + if form.start_date.year == 2023 + 30 + (4 * @person_index) + else + 29 + (4 * @person_index) + end + end end diff --git a/app/models/form/lettings/questions/person_working_situation.rb b/app/models/form/lettings/questions/person_working_situation.rb index dce08af4f..61efb5f9f 100644 --- a/app/models/form/lettings/questions/person_working_situation.rb +++ b/app/models/form/lettings/questions/person_working_situation.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question @check_answers_card_number = person_index @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 33 + (4 * person_index) + @person_index = person_index end ANSWER_OPTIONS = { @@ -31,4 +31,12 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question "divider" => { "value" => true }, "10" => { "value" => "Person prefers not to say" }, }.freeze + + def question_number + if form.start_date.year == 2023 + 33 + (4 * @person_index) + else + 32 + (4 * @person_index) + end + end end diff --git a/app/models/form/lettings/questions/postcode_for_full_address.rb b/app/models/form/lettings/questions/postcode_for_full_address.rb index 8f7de5f52..1bd697227 100644 --- a/app/models/form/lettings/questions/postcode_for_full_address.rb +++ b/app/models/form/lettings/questions/postcode_for_full_address.rb @@ -19,7 +19,9 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question @plain_label = true @check_answer_label = "Postcode" @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = 12 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @hide_question_number_on_page = true end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/ppcodenk.rb b/app/models/form/lettings/questions/ppcodenk.rb index 88ca5277f..bb662d722 100644 --- a/app/models/form/lettings/questions/ppcodenk.rb +++ b/app/models/form/lettings/questions/ppcodenk.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [0] } @hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] } - @question_number = 80 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end @@ -18,4 +18,6 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question "0" => { "value" => "Yes" }, "1" => { "value" => "No" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79 }.freeze end diff --git a/app/models/form/lettings/questions/ppostcode_full.rb b/app/models/form/lettings/questions/ppostcode_full.rb index edcbaf30a..fd44bae42 100644 --- a/app/models/form/lettings/questions/ppostcode_full.rb +++ b/app/models/form/lettings/questions/ppostcode_full.rb @@ -15,7 +15,9 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } } - @question_number = 80 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79 }.freeze end diff --git a/app/models/form/lettings/questions/preg_occ.rb b/app/models/form/lettings/questions/preg_occ.rb index 8a863a870..862da6116 100644 --- a/app/models/form/lettings/questions/preg_occ.rb +++ b/app/models/form/lettings/questions/preg_occ.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 69 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 68 }.freeze end diff --git a/app/models/form/lettings/questions/previous_la_known.rb b/app/models/form/lettings/questions/previous_la_known.rb index acf0da53c..769492430 100644 --- a/app/models/form/lettings/questions/previous_la_known.rb +++ b/app/models/form/lettings/questions/previous_la_known.rb @@ -10,9 +10,11 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "prevloc" => [1] } @hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] } - @question_number = 81 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80 }.freeze end diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index 6ce55da42..8d49c5afa 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "This is the rent type of the previous tenancy in this property." : "" @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS - @question_number = 16 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -32,4 +32,6 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/previous_tenure.rb b/app/models/form/lettings/questions/previous_tenure.rb index ca5b8d832..f0efdceb6 100644 --- a/app/models/form/lettings/questions/previous_tenure.rb +++ b/app/models/form/lettings/questions/previous_tenure.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question @check_answers_card_number = 0 @hint_text = "This is where the household was the night before they moved." @answer_options = ANSWER_OPTIONS - @question_number = 78 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -39,4 +39,6 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question "4" => { "value" => "Tied housing or rented with job" }, "25" => { "value" => "Any other accommodation" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77 }.freeze end diff --git a/app/models/form/lettings/questions/previous_tenure_renewal.rb b/app/models/form/lettings/questions/previous_tenure_renewal.rb index 56be9a95d..e272c4b95 100644 --- a/app/models/form/lettings/questions/previous_tenure_renewal.rb +++ b/app/models/form/lettings/questions/previous_tenure_renewal.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 78 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question "35" => { "value" => "Extra care housing" }, "6" => { "value" => "Other supported housing" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77 }.freeze end diff --git a/app/models/form/lettings/questions/prevloc.rb b/app/models/form/lettings/questions/prevloc.rb index e0082602e..67c2f6ea2 100644 --- a/app/models/form/lettings/questions/prevloc.rb +++ b/app/models/form/lettings/questions/prevloc.rb @@ -8,11 +8,13 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question @inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }] @check_answers_card_number = 0 @hint_text = "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England." - @question_number = 81 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end def answer_options { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).map { |la| [la.code, la.name] }.to_h) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80 }.freeze end diff --git a/app/models/form/lettings/questions/property_reference.rb b/app/models/form/lettings/questions/property_reference.rb index f93a57cee..a1224330a 100644 --- a/app/models/form/lettings/questions/property_reference.rb +++ b/app/models/form/lettings/questions/property_reference.rb @@ -7,6 +7,8 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question @hint_text = "This is how you usually refer to this property on your own systems." @type = "text" @width = 10 - @question_number = 8 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 8, 2024 => 10 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb index cb716abd2..afdea49de 100644 --- a/app/models/form/lettings/questions/pscharge_4_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = 97 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_bi_weekly.rb b/app/models/form/lettings/questions/pscharge_bi_weekly.rb index bd3524b10..7970638b0 100644 --- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = 97 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb index bae5bd459..ca58c284c 100644 --- a/app/models/form/lettings/questions/pscharge_monthly.rb +++ b/app/models/form/lettings/questions/pscharge_monthly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = 97 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb index 1b24e9a10..4f6bab27b 100644 --- a/app/models/form/lettings/questions/pscharge_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = 97 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb index a60cc3b3f..d8aa19e54 100644 --- a/app/models/form/lettings/questions/reason.rb +++ b/app/models/form/lettings/questions/reason.rb @@ -12,7 +12,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question 20, ], } - @question_number = 77 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -92,4 +92,6 @@ class Form::Lettings::Questions::Reason < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76 }.freeze end diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index e62041780..36e673907 100644 --- a/app/models/form/lettings/questions/reason_renewal.rb +++ b/app/models/form/lettings/questions/reason_renewal.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "You told us this letting is a renewal. We have removed some options because of this." - @question_number = 77 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @conditional_for = { "reasonother" => [ 20, @@ -38,4 +38,6 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76 }.freeze end diff --git a/app/models/form/lettings/questions/reasonable_preference_reason.rb b/app/models/form/lettings/questions/reasonable_preference_reason.rb index 631949685..bb46ab70b 100644 --- a/app/models/form/lettings/questions/reasonable_preference_reason.rb +++ b/app/models/form/lettings/questions/reasonable_preference_reason.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS - @question_number = 83 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -19,4 +19,6 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question "divider" => { "value" => true }, "rp_dontknow" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 83, 2024 => 82 }.freeze end diff --git a/app/models/form/lettings/questions/reasonother.rb b/app/models/form/lettings/questions/reasonother.rb index e045c9aa3..81ad83331 100644 --- a/app/models/form/lettings/questions/reasonother.rb +++ b/app/models/form/lettings/questions/reasonother.rb @@ -7,6 +7,8 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question @type = "text" @check_answers_card_number = 0 @hint_text = "" - @question_number = 77 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76 }.freeze end diff --git a/app/models/form/lettings/questions/reasonpref.rb b/app/models/form/lettings/questions/reasonpref.rb index 2493033bd..bb6934f65 100644 --- a/app/models/form/lettings/questions/reasonpref.rb +++ b/app/models/form/lettings/questions/reasonpref.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’." : "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority." @answer_options = ANSWER_OPTIONS - @question_number = 82 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Don’t know" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 81 }.freeze end diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb index 7f0fb3c41..9c702e7de 100644 --- a/app/models/form/lettings/questions/referral.rb +++ b/app/models/form/lettings/questions/referral.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question @check_answers_card_number = 0 @hint_text = "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this." @answer_options = ANSWER_OPTIONS - @question_number = 85 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -50,4 +50,6 @@ class Form::Lettings::Questions::Referral < ::Form::Question "value" => "Other", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index a1ec41fd5..466b52a44 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question @check_answers_card_number = 0 @hint_text = "You told us that the needs type is general needs. We have removed some options because of this." @answer_options = ANSWER_OPTIONS - @question_number = 85 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -56,4 +56,6 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question "value" => "Other", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index b6b6b1567..d3b0144f9 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question @check_answers_card_number = 0 @hint_text = "You told us that you are a local authority. We have removed some options because of this." @answer_options = ANSWER_OPTIONS - @question_number = 85 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -53,4 +53,6 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question "value" => "Other", }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb index 207eb0e8a..ff301777a 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 85 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -27,4 +27,6 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question "17" => { "value" => "Children’s Social Care" }, "16" => { "value" => "Other" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/renewal.rb b/app/models/form/lettings/questions/renewal.rb index 1320a0f45..c38790a8b 100644 --- a/app/models/form/lettings/questions/renewal.rb +++ b/app/models/form/lettings/questions/renewal.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Renewal < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = hint_text - @question_number = 4 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end ANSWER_OPTIONS = { @@ -31,4 +31,6 @@ class Form::Lettings::Questions::Renewal < ::Form::Question "A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'" end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze end diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index 4ff1a0d32..9b3e0ff37 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question @top_guidance_partial = "rent_type_definitions" @answer_options = ANSWER_OPTIONS @conditional_for = { "irproduct_other" => [5] } - @question_number = 6 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end ANSWER_OPTIONS = { @@ -19,4 +19,6 @@ class Form::Lettings::Questions::RentType < ::Form::Question "0" => { "value" => "Social Rent" }, "5" => { "value" => "Other intermediate rent product" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze end diff --git a/app/models/form/lettings/questions/reservist.rb b/app/models/form/lettings/questions/reservist.rb index 44eb8219d..f29ff8a15 100644 --- a/app/models/form/lettings/questions/reservist.rb +++ b/app/models/form/lettings/questions/reservist.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Reservist < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 68 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -17,4 +17,6 @@ class Form::Lettings::Questions::Reservist < ::Form::Question "divider" => { "value" => true }, "3" => { "value" => "Person prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 68, 2024 => 67 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index d443d039d..6f3746c5f 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @question_number = 17 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -101,4 +101,6 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question } end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb index df66b57cd..514decc0c 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 15 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -16,4 +16,6 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question "17" => { "value" => "First let of leased property" }, "15" => { "value" => "First let of new-build property" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_4_weekly.rb b/app/models/form/lettings/questions/scharge_4_weekly.rb index b13c8339b..001cc1188 100644 --- a/app/models/form/lettings/questions/scharge_4_weekly.rb +++ b/app/models/form/lettings/questions/scharge_4_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = 96 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_bi_weekly.rb b/app/models/form/lettings/questions/scharge_bi_weekly.rb index 679662e64..63b4411f1 100644 --- a/app/models/form/lettings/questions/scharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = 96 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb index 74f35578c..c711c17b1 100644 --- a/app/models/form/lettings/questions/scharge_monthly.rb +++ b/app/models/form/lettings/questions/scharge_monthly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = 96 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb index c8788b7bd..353b55f67 100644 --- a/app/models/form/lettings/questions/scharge_weekly.rb +++ b/app/models/form/lettings/questions/scharge_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = 96 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/scheme_id.rb b/app/models/form/lettings/questions/scheme_id.rb index 8d906f134..5471ce551 100644 --- a/app/models/form/lettings/questions/scheme_id.rb +++ b/app/models/form/lettings/questions/scheme_id.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question @answer_options = answer_options @top_guidance_partial = "finding_scheme" @bottom_guidance_partial = "scheme_selection" - @question_number = 9 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? @inferred_answers = { "location.name": { "scheme_has_multiple_locations?": false, @@ -58,4 +58,6 @@ private def selected_answer_option_is_derived?(_lettings_log) false end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 4 }.freeze end diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index b8379469c..72aefa2d7 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." - @question_number = 29 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -28,4 +28,6 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question "4" => { "value" => "Don’t know" } } end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index db67bbb7f..e002c5c43 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’." @conditional_for = { "tenancyother" => [3] } - @question_number = 27 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -66,4 +66,6 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 6a8eb7a27..0bf792b53 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = 26 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze @@ -20,4 +20,6 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question "This is also known as an ‘introductory period’." end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze end diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index 6b5e77c6d..694b584c3 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question @check_answer_label = "Stock owner" @header = "Which organisation owns this property?" @type = "select" - @question_number = 1 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end def answer_options(log = nil, user = nil) @@ -89,4 +89,6 @@ private def merged_organisation_label(name, merge_date) "#{name} (inactive as of #{merge_date.to_fs(:govuk_date)})" end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 1 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb index 1ca7da652..1bbdce045 100644 --- a/app/models/form/lettings/questions/supcharg_4_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = 98 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb index 07150f6f0..2f078eefb 100644 --- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = 98 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb index 224ddc31c..37c324e39 100644 --- a/app/models/form/lettings/questions/supcharg_monthly.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = 98 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb index 4e0c99057..d0802826d 100644 --- a/app/models/form/lettings/questions/supcharg_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -14,6 +14,8 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = 98 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index 7dd572560..e24a57d02 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -11,6 +11,8 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question @min = 0 @hint_text = "Do not include the starter or introductory period." @step = 1 - @question_number = 28 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb index 739e5e606..14135aeca 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = 28 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def hint_text @@ -20,4 +20,6 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies." end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index 829fa1244..7cc576365 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @max = 150 @min = 0 @step = 1 - @question_number = 28 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def hint_text @@ -20,4 +20,6 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies." end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index 4c0d9a51d..f05f9990a 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -10,7 +10,9 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = 28 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @hint_text = "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index c19b03703..f1f2b8cc4 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -7,6 +7,8 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question @type = "text" @check_answers_card_number = 0 @hint_text = "" - @question_number = 27 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb index fd9d63cec..08ddb131a 100644 --- a/app/models/form/lettings/questions/tenancy_start_date.rb +++ b/app/models/form/lettings/questions/tenancy_start_date.rb @@ -6,6 +6,8 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question @header = "What is the tenancy start date?" @type = "date" @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." - @question_number = 5 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index 6a7642123..e26f4aac4 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @conditional_for = { "tenancyother" => [3] } - @question_number = 27 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -66,4 +66,6 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/tenant_code.rb b/app/models/form/lettings/questions/tenant_code.rb index f51d33c46..bf00fad7d 100644 --- a/app/models/form/lettings/questions/tenant_code.rb +++ b/app/models/form/lettings/questions/tenant_code.rb @@ -7,6 +7,8 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question @hint_text = "This is how you usually refer to this tenancy on your own systems." @type = "text" @width = 10 - @question_number = 7 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) if form.start_date.present? end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 7, 2024 => 9 }.freeze end diff --git a/app/models/form/lettings/questions/town_or_city.rb b/app/models/form/lettings/questions/town_or_city.rb index 43aa48625..e0d40e6a7 100644 --- a/app/models/form/lettings/questions/town_or_city.rb +++ b/app/models/form/lettings/questions/town_or_city.rb @@ -7,7 +7,9 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question @plain_label = true @check_answer_label = "Town or city" @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = 12 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @hide_question_number_on_page = true end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb index 69697ca44..7d89ab309 100644 --- a/app/models/form/lettings/questions/tshortfall.rb +++ b/app/models/form/lettings/questions/tshortfall.rb @@ -22,6 +22,8 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question { "label" => " every week for 52 weeks", "depends_on" => { "period" => 1 } }, { "label" => " every week for 53 weeks", "depends_on" => { "period" => 10 } }, ] - @question_number = 100 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb index 7082af4f3..c1310e0ec 100644 --- a/app/models/form/lettings/questions/tshortfall_known.rb +++ b/app/models/form/lettings/questions/tshortfall_known.rb @@ -9,8 +9,10 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question @hint_text = "You only need to give an approximate figure." @answer_options = ANSWER_OPTIONS @conditional_for = { "tshortfall" => [0] } - @question_number = 100 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze end diff --git a/app/models/form/lettings/questions/unittype_gn.rb b/app/models/form/lettings/questions/unittype_gn.rb index 01f38b0b9..a34910f7a 100644 --- a/app/models/form/lettings/questions/unittype_gn.rb +++ b/app/models/form/lettings/questions/unittype_gn.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS - @question_number = 19 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -21,4 +21,6 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question "9" => { "value" => "Shared house" }, "6" => { "value" => "Other" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 19 }.freeze end diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb index f33084a22..0271dfeb2 100644 --- a/app/models/form/lettings/questions/uprn.rb +++ b/app/models/form/lettings/questions/uprn.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::Uprn < ::Form::Question @header = "What is the property's UPRN?" @type = "text" @width = 10 - @question_number = 11 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @inferred_check_answers_value = [ { "condition" => { "uprn_known" => 0 }, @@ -35,4 +35,6 @@ class Form::Lettings::Questions::Uprn < ::Form::Question "\n\n#{value.join("\n")}" end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12 }.freeze end diff --git a/app/models/form/lettings/questions/voiddate.rb b/app/models/form/lettings/questions/voiddate.rb index 38064bb3e..0e2321746 100644 --- a/app/models/form/lettings/questions/voiddate.rb +++ b/app/models/form/lettings/questions/voiddate.rb @@ -6,7 +6,9 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question @header = "What is the void date?" @type = "date" @check_answers_card_number = 0 - @question_number = 23 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) @top_guidance_partial = "void_date" end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 23 }.freeze end diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 7ca4938f9..fbc89094e 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @question_number = 76 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end def answer_options @@ -36,4 +36,6 @@ class Form::Lettings::Questions::Waityear < ::Form::Question }.freeze end end + + QUESION_NUMBER_FROM_YEAR = { 2023 => 76, 2024 => 75 }.freeze end diff --git a/app/models/form/lettings/questions/wheelchair.rb b/app/models/form/lettings/questions/wheelchair.rb index c2aaa3700..8319a6a6f 100644 --- a/app/models/form/lettings/questions/wheelchair.rb +++ b/app/models/form/lettings/questions/wheelchair.rb @@ -8,11 +8,13 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question @check_answers_card_number = 0 @hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : "" @answer_options = ANSWER_OPTIONS - @question_number = 21 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 21 }.freeze end diff --git a/app/models/form/lettings/questions/working_situation1.rb b/app/models/form/lettings/questions/working_situation1.rb index 4975b4125..0e80d6b97 100644 --- a/app/models/form/lettings/questions/working_situation1.rb +++ b/app/models/form/lettings/questions/working_situation1.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS - @question_number = 37 + @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last) end ANSWER_OPTIONS = { @@ -24,4 +24,6 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question "divider" => { "value" => true }, "10" => { "value" => "Tenant prefers not to say" }, }.freeze + + QUESION_NUMBER_FROM_YEAR = { 2023 => 37, 2024 => 36 }.freeze end