Browse Source

CLDC-4402: lettings subsections

CLDC-4402-audit-start-year-2024-or-later-usage
samyou-softwire 1 week ago
parent
commit
ce83e5796f
  1. 2
      app/models/form/lettings/questions/declaration.rb
  2. 1
      app/models/form/lettings/subsections/household_characteristics.rb
  3. 2
      app/models/form/lettings/subsections/household_situation.rb
  4. 18
      app/models/form/lettings/subsections/property_information.rb
  5. 2
      app/models/form/lettings/subsections/setup.rb
  6. 2
      app/models/form/lettings/subsections/tenancy_information.rb

2
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

1
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?),

2
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),

18
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

2
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

2
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

Loading…
Cancel
Save