diff --git a/app/models/form/sales/pages/building_height_class.rb b/app/models/form/sales/pages/building_height_class.rb new file mode 100644 index 000000000..3e3547225 --- /dev/null +++ b/app/models/form/sales/pages/building_height_class.rb @@ -0,0 +1,17 @@ +class Form::Sales::Pages::BuildingHeightClass < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "building_height_class" + @depends_on = [ + { "proptype" => 1 }, + { "proptype" => 2 }, + { "proptype" => 9 }, + ] + end + + def questions + @questions ||= [ + Form::Sales::Questions::BuildingHeightClass.new(nil, nil, self), + ] + end +end diff --git a/app/models/form/sales/questions/building_height_class.rb b/app/models/form/sales/questions/building_height_class.rb new file mode 100644 index 000000000..016245fbc --- /dev/null +++ b/app/models/form/sales/questions/building_height_class.rb @@ -0,0 +1,17 @@ +class Form::Sales::Questions::BuildingHeightClass < ::Form::Question + def initialize(id, hsh, page) + super + @id = "buildheightclass" + @type = "radio" + @answer_options = ANSWER_OPTIONS + @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + end + + ANSWER_OPTIONS = { + "1" => { "value" => "High-rise" }, + "2" => { "value" => "Low-rise" }, + "3" => { "value" => "Don't know" }, + }.freeze + + QUESTION_NUMBER_FROM_YEAR = { 2026 => 17 }.freeze +end diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index e33666208..07464ea1b 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -10,6 +10,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection @pages ||= [ (uprn_questions if form.start_date.year >= 2024), (Form::Sales::Pages::PropertyUnitType.new(nil, nil, self) if form.start_year_2025_or_later?), + (Form::Sales::Pages::BuildingHeightClass.new(nil, nil, self) if form.start_year_2026_or_later?), Form::Sales::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_bedrooms_value_check", nil, self), (Form::Sales::Pages::PropertyUnitType.new(nil, nil, self) unless form.start_year_2025_or_later?), diff --git a/config/locales/forms/2026/sales/property_information.en.yml b/config/locales/forms/2026/sales/property_information.en.yml index 70afb55d8..b63ea755c 100644 --- a/config/locales/forms/2026/sales/property_information.en.yml +++ b/config/locales/forms/2026/sales/property_information.en.yml @@ -59,6 +59,13 @@ en: hint_text: "" question_text: "What type of unit is the property?" + buildheightclass: + page_header: "" + check_answer_label: "Building height classification" + check_answer_prompt: "" + hint_text: "High-rise residential buildings are those containing 2 or more residential units and either have 7 or more storeys or are at least 18 metres in height. If unsure, answer based on the number of storeys." + question_text: "What is the building height classification?" + builtype: page_header: "" check_answer_label: "Type of building"