From ce83e5796f9c0ae05351e0d148b507bc09186368 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Fri, 24 Apr 2026 10:21:55 +0100 Subject: [PATCH] CLDC-4402: lettings subsections --- .../form/lettings/questions/declaration.rb | 2 +- .../subsections/household_characteristics.rb | 1 - .../subsections/household_situation.rb | 2 +- .../subsections/property_information.rb | 18 +++++------------- app/models/form/lettings/subsections/setup.rb | 2 +- .../subsections/tenancy_information.rb | 2 +- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 67465cfcb..1dd3b65dc 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question @id = "declaration" @type = "checkbox" @top_guidance_partial = "privacy_notice_tenant" - @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end def answer_options diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index 50e2cfa61..3d3607834 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -8,7 +8,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection def pages @pages ||= [ - (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_2024_or_later?), Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self), (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), diff --git a/app/models/form/lettings/subsections/household_situation.rb b/app/models/form/lettings/subsections/household_situation.rb index cc6ec59de..4b1f9aa7d 100644 --- a/app/models/form/lettings/subsections/household_situation.rb +++ b/app/models/form/lettings/subsections/household_situation.rb @@ -12,7 +12,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::TimeOnWaitingList.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHome.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal.new(nil, nil, self), - (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_2024_or_later?), + Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituation.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituationRenewal.new(nil, nil, self), Form::Lettings::Pages::Homelessness.new("homelessness", nil, self), diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index b204fb00d..0ba8eb1c9 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -28,22 +28,14 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection end def uprn_questions - if form.start_year_2024_or_later? - [ - Form::Lettings::Pages::AddressSearch.new(nil, nil, self), - Form::Lettings::Pages::AddressFallback.new(nil, nil, self), - ] - else - [ - Form::Lettings::Pages::Uprn.new(nil, nil, self), - Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), - Form::Lettings::Pages::Address.new(nil, nil, self), - ] - end + [ + Form::Lettings::Pages::AddressSearch.new(nil, nil, self), + Form::Lettings::Pages::AddressFallback.new(nil, nil, self), + ] end def number_of_times_relet - Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_2024_or_later? + nil end def first_let_questions diff --git a/app/models/form/lettings/subsections/setup.rb b/app/models/form/lettings/subsections/setup.rb index 0e65c2f13..83f7091ee 100644 --- a/app/models/form/lettings/subsections/setup.rb +++ b/app/models/form/lettings/subsections/setup.rb @@ -20,7 +20,7 @@ class Form::Lettings::Subsections::Setup < ::Form::Subsection Form::Lettings::Pages::RentType.new(nil, nil, self), Form::Lettings::Pages::TenantCode.new(nil, nil, self), Form::Lettings::Pages::PropertyReference.new(nil, nil, self), - (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_2024_or_later?), + Form::Lettings::Pages::Declaration.new(nil, nil, self), ].compact end diff --git a/app/models/form/lettings/subsections/tenancy_information.rb b/app/models/form/lettings/subsections/tenancy_information.rb index e6ff48457..20dd3cd2d 100644 --- a/app/models/form/lettings/subsections/tenancy_information.rb +++ b/app/models/form/lettings/subsections/tenancy_information.rb @@ -16,7 +16,7 @@ class Form::Lettings::Subsections::TenancyInformation < ::Form::Subsection Form::Lettings::Pages::TenancyLength.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self), - (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_2024_or_later?), + Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self), (Form::Lettings::Pages::ShelteredAccommodation.new(nil, nil, self) unless form.start_year_2025_or_later?), ].flatten.compact end