Browse Source

Extract more question information

pull/2726/head
Manny Dinssa 10 months ago
parent
commit
9bbc0fb7e4
  1. 1
      app/models/form/lettings/pages/property_major_repairs.rb
  2. 1
      app/models/form/lettings/pages/uprn.rb
  3. 1
      app/models/form/lettings/pages/void_date.rb
  4. 6
      app/models/form/lettings/questions/beds.rb
  5. 3
      app/models/form/lettings/questions/builtype.rb
  6. 3
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  7. 2
      app/models/form/lettings/questions/la.rb
  8. 4
      app/models/form/lettings/questions/majorrepairs.rb
  9. 3
      app/models/form/lettings/questions/mrcdate.rb
  10. 2
      app/models/form/lettings/questions/offered.rb
  11. 3
      app/models/form/lettings/questions/previous_let_type.rb
  12. 3
      app/models/form/lettings/questions/rsnvac.rb
  13. 3
      app/models/form/lettings/questions/rsnvac_first_let.rb
  14. 3
      app/models/form/lettings/questions/unittype_gn.rb
  15. 2
      app/models/form/lettings/questions/voiddate.rb
  16. 3
      app/models/form/lettings/questions/wheelchair.rb
  17. 12
      app/models/form/lettings/subsections/property_information.rb
  18. 3
      config/locales/en.yml
  19. 40
      config/locales/forms/2023/lettings/property_information.en.yml
  20. 46
      config/locales/forms/2024/lettings/property_information.en.yml

1
app/models/form/lettings/pages/property_major_repairs.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "property_major_repairs" @id = "property_major_repairs"
@copy_key = "lettings.property_information.property_major_repairs"
@depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }] @depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }]
end end

1
app/models/form/lettings/pages/uprn.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "uprn" @id = "uprn"
@copy_key = "lettings.property_information.uprn"
@depends_on = [{ "is_supported_housing?" => false }] @depends_on = [{ "is_supported_housing?" => false }]
end end

1
app/models/form/lettings/pages/void_date.rb

@ -2,7 +2,6 @@ class Form::Lettings::Pages::VoidDate < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "void_date" @id = "void_date"
@header = "Void date"
@depends_on = [{ "is_renewal?" => false }] @depends_on = [{ "is_renewal?" => false }]
end end

6
app/models/form/lettings/questions/beds.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Beds < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "beds" @id = "beds"
@check_answer_label = "Number of bedrooms"
@header = "How many bedrooms does the property have?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -17,9 +15,5 @@ class Form::Lettings::Questions::Beds < ::Form::Question
log.is_bedsit? log.is_bedsit?
end 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
QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze
end end

3
app/models/form/lettings/questions/builtype.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Builtype < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "builtype" @id = "builtype"
@check_answer_label = "Type of building"
@header = "What type of building is the property?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "first_time_property_let_as_social_housing" @id = "first_time_property_let_as_social_housing"
@check_answer_label = "First time being let as social-housing?"
@header = "Is this the first time the property has been let as social housing?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/la.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::La < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "la" @id = "la"
@check_answer_label = "Local Authority"
@header = "What is the property’s local authority?"
@type = "select" @type = "select"
@check_answers_card_number = nil @check_answers_card_number = nil
@hint_text = "" @hint_text = ""

4
app/models/form/lettings/questions/majorrepairs.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "majorrepairs" @id = "majorrepairs"
@check_answer_label = "Major repairs carried out during void period" @copy_key = "lettings.property_information.property_major_repairs.majorrepairs"
@header = "Were any major repairs carried out during the void period?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@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 @answer_options = ANSWER_OPTIONS
@conditional_for = { "mrcdate" => [1] } @conditional_for = { "mrcdate" => [1] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

3
app/models/form/lettings/questions/mrcdate.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "mrcdate" @id = "mrcdate"
@check_answer_label = "Completion date of repairs" @copy_key = "lettings.property_information.property_major_repairs.mrcdate"
@header = "When were the repairs completed?"
@type = "date" @type = "date"
@check_answers_card_number = 0 @check_answers_card_number = 0
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

2
app/models/form/lettings/questions/offered.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Offered < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "offered" @id = "offered"
@check_answer_label = I18n.t("check_answer_labels.offered")
@header = I18n.t("questions.offered")
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0

3
app/models/form/lettings/questions/previous_let_type.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "unitletas" @id = "unitletas"
@check_answer_label = "Most recent let type"
@header = "What type was the property most recently let as?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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 @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/rsnvac.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rsnvac" @id = "rsnvac"
@check_answer_label = "Vacancy reason"
@header = "What is the reason for the property being vacant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/rsnvac_first_let.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rsnvac" @id = "rsnvac"
@check_answer_label = "Vacancy reason"
@header = "What is the reason for the property being vacant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/unittype_gn.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "unittype_gn" @id = "unittype_gn"
@check_answer_label = "Type of unit"
@header = "What type of unit is the property?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/voiddate.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "voiddate" @id = "voiddate"
@check_answer_label = "Void date"
@header = "What is the void date?"
@type = "date" @type = "date"
@check_answers_card_number = 0 @check_answers_card_number = 0
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

3
app/models/form/lettings/questions/wheelchair.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "wchair" @id = "wchair"
@check_answer_label = "Property built or adapted to wheelchair-user standards"
@header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

12
app/models/form/lettings/subsections/property_information.rb

@ -10,8 +10,8 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
@pages ||= [ @pages ||= [
uprn_questions, uprn_questions,
Form::Lettings::Pages::PropertyLocalAuthority.new(nil, nil, self), Form::Lettings::Pages::PropertyLocalAuthority.new(nil, nil, self),
Form::Lettings::Pages::MinRentValueCheck.new("local_authority_min_rent_value_check", nil, self, check_answers_card_number: nil), Form::Lettings::Pages::MinRentValueCheck.new("local_authority_min_rent_value_check", nil, self, check_answers_card_number: nil), #Soft validation
Form::Lettings::Pages::MaxRentValueCheck.new("local_authority_max_rent_value_check", nil, self, check_answers_card_number: nil), Form::Lettings::Pages::MaxRentValueCheck.new("local_authority_max_rent_value_check", nil, self, check_answers_card_number: nil), #Soft validation
Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self), Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self),
Form::Lettings::Pages::PropertyLetType.new(nil, nil, self), Form::Lettings::Pages::PropertyLetType.new(nil, nil, self),
Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet.new(nil, nil, self), Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet.new(nil, nil, self),
@ -21,12 +21,12 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self), Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self),
Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self), Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self),
Form::Lettings::Pages::MinRentValueCheck.new("beds_min_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::MinRentValueCheck.new("beds_min_rent_value_check", nil, self, check_answers_card_number: 0), #Soft validation
Form::Lettings::Pages::MaxRentValueCheck.new("beds_max_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::MaxRentValueCheck.new("beds_max_rent_value_check", nil, self, check_answers_card_number: 0), #Soft validation
Form::Lettings::Pages::VoidDate.new(nil, nil, self), Form::Lettings::Pages::VoidDate.new(nil, nil, self),
Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self), Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self), #Soft validation
Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self),
Form::Lettings::Pages::PropertyMajorRepairsValueCheck.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairsValueCheck.new(nil, nil, self), #Soft validation
].flatten.compact ].flatten.compact
end end

3
config/locales/en.yml

@ -828,7 +828,6 @@ Make sure these answers are correct."
stairowned: stairowned:
one: "What percentage of the property does the buyer now own in total?" one: "What percentage of the property does the buyer now own in total?"
other: "What percentage of the property do the buyers now own in total?" other: "What percentage of the property do the buyers now own in total?"
offered: "How many times was the property offered between becoming vacant and this letting?"
hints: hints:
location: location:
@ -841,7 +840,6 @@ Make sure these answers are correct."
toggle_active: "If the date is before %{date}, select ‘From the start of the open collection period’ because the previous period has now closed." toggle_active: "If the date is before %{date}, select ‘From the start of the open collection period’ because the previous period has now closed."
bulk_upload: bulk_upload:
needstype: "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." needstype: "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."
offered: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0."
check_answer_labels: check_answer_labels:
soctenant: soctenant:
@ -850,7 +848,6 @@ Make sure these answers are correct."
stairowned: stairowned:
one: "Percentage the buyer now owns in total." one: "Percentage the buyer now owns in total."
other: "Percentage the buyers now own in total." other: "Percentage the buyers now own in total."
offered: "Times previously offered since becoming available."
warnings: warnings:
organisation: organisation:

40
config/locales/forms/2023/lettings/property_information.en.yml

@ -49,13 +49,31 @@ en:
hint_text: "" hint_text: ""
question_text: "What is the property’s local authority?" question_text: "What is the property’s local authority?"
beds: first_time_property_let_as_social_housing:
page_header: "" page_header: ""
check_answer_label: "Number of bedrooms" check_answer_label: "First time being let as social-housing?"
hint_text: "A bedsit has 1 bedroom." hint_text: ""
question_text: "How many bedrooms does the property have?" question_text: "Is this the first time the property has been let as social housing?"
unitletas:
page_header: ""
check_answer_label: "Most recent let type"
hint_text: ""
question_text: "What type was the property most recently let as?"
rsnvac:
page_header: ""
check_answer_label: "Vacancy reason"
hint_text: ""
question_text: "What is the reason for the property being vacant?"
proptype: offered:
page_header: ""
check_answer_label: "Times previously offered since becoming available."
hint_text: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0."
question_text: "How many times was the property offered between becoming vacant and this letting?"
unittype_gn:
page_header: "" page_header: ""
check_answer_label: "Type of unit" check_answer_label: "Type of unit"
hint_text: "" hint_text: ""
@ -72,3 +90,15 @@ en:
check_answer_label: "Property built or adapted to wheelchair-user standards" check_answer_label: "Property built or adapted to wheelchair-user standards"
hint_text: "" hint_text: ""
question_text: "Is the property built or adapted to wheelchair-user standards?" question_text: "Is the property built or adapted to wheelchair-user standards?"
beds:
page_header: ""
check_answer_label: "Number of bedrooms"
hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom."
question_text: "How many bedrooms does the property have?"
voiddate:
page_header: "Void date"
check_answer_label: "Void date"
hint_text: ""
question_text: "What is the void date?"

46
config/locales/forms/2024/lettings/property_information.en.yml

@ -66,13 +66,25 @@ en:
hint_text: "" hint_text: ""
question_text: "What is the property’s local authority?" question_text: "What is the property’s local authority?"
beds: first_time_property_let_as_social_housing:
page_header: "" page_header: ""
check_answer_label: "Number of bedrooms" check_answer_label: "First time being let as social-housing?"
hint_text: "A bedsit has 1 bedroom." hint_text: ""
question_text: "How many bedrooms does the property have?" question_text: "Is this the first time the property has been let as social housing?"
unitletas:
page_header: ""
check_answer_label: "Most recent let type"
hint_text: "This is the rent type of the previous tenancy in this property."
question_text: "What type was the property most recently let as?"
proptype: rsnvac:
page_header: ""
check_answer_label: "Vacancy reason"
hint_text: ""
question_text: "What is the reason for the property being vacant?"
unittype_gn:
page_header: "" page_header: ""
check_answer_label: "Type of unit" check_answer_label: "Type of unit"
hint_text: "" hint_text: ""
@ -87,6 +99,28 @@ en:
wchair: wchair:
page_header: "" page_header: ""
check_answer_label: "Property built or adapted to wheelchair-user standards" check_answer_label: "Property built or adapted to wheelchair-user standards"
hint_text: "" hint_text: "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."
question_text: "Is the property built or adapted to wheelchair-user standards?" question_text: "Is the property built or adapted to wheelchair-user standards?"
beds:
page_header: ""
check_answer_label: "Number of bedrooms"
hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household."
question_text: "How many bedrooms does the property have?"
voiddate:
page_header: "Void date"
check_answer_label: "Void date"
hint_text: ""
question_text: "What is the void date?"
property_major_repairs:
page_header: ""
majorrepairs:
check_answer_label: "Major repairs carried out during void period"
hint_text: "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs."
question_text: "Were any major repairs carried out during the void period?"
mrcdate:
check_answer_label: "Completion date of repairs"
hint_text: ""
question_text: "When were the repairs completed?"

Loading…
Cancel
Save