Browse Source

CLDC-3683 Extract lettings household situation copy (#2730)

* Extract lettings household situation copy

* Update wrong copy, remove duplicate keys
pull/2725/head^2
kosiakkatrina 2 months ago committed by GitHub
parent
commit
3cda5adf5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/models/form/lettings/pages/previous_housing_situation.rb
  2. 1
      app/models/form/lettings/pages/previous_housing_situation_renewal.rb
  3. 1
      app/models/form/lettings/pages/previous_local_authority.rb
  4. 1
      app/models/form/lettings/pages/previous_postcode.rb
  5. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
  6. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
  7. 1
      app/models/form/lettings/pages/referral.rb
  8. 1
      app/models/form/lettings/pages/referral_prp.rb
  9. 1
      app/models/form/lettings/pages/referral_supported_housing.rb
  10. 1
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  11. 3
      app/models/form/lettings/questions/homeless.rb
  12. 3
      app/models/form/lettings/questions/layear.rb
  13. 3
      app/models/form/lettings/questions/letting_allocation.rb
  14. 4
      app/models/form/lettings/questions/ppcodenk.rb
  15. 4
      app/models/form/lettings/questions/ppostcode_full.rb
  16. 4
      app/models/form/lettings/questions/previous_la_known.rb
  17. 4
      app/models/form/lettings/questions/previous_tenure.rb
  18. 5
      app/models/form/lettings/questions/previous_tenure_renewal.rb
  19. 4
      app/models/form/lettings/questions/prevloc.rb
  20. 4
      app/models/form/lettings/questions/reason.rb
  21. 4
      app/models/form/lettings/questions/reason_renewal.rb
  22. 3
      app/models/form/lettings/questions/reasonable_preference_reason.rb
  23. 4
      app/models/form/lettings/questions/reasonother.rb
  24. 3
      app/models/form/lettings/questions/reasonpref.rb
  25. 4
      app/models/form/lettings/questions/referral.rb
  26. 4
      app/models/form/lettings/questions/referral_prp.rb
  27. 4
      app/models/form/lettings/questions/referral_supported_housing.rb
  28. 4
      app/models/form/lettings/questions/referral_supported_housing_prp.rb
  29. 3
      app/models/form/lettings/questions/waityear.rb
  30. 120
      config/locales/forms/2023/lettings/household_situation.en.yml
  31. 120
      config/locales/forms/2024/lettings/household_situation.en.yml
  32. 2
      spec/models/form/lettings/questions/homeless_spec.rb
  33. 2
      spec/models/form/lettings/questions/reason_renewal_spec.rb
  34. 2
      spec/models/form/lettings/questions/reason_spec.rb

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_housing_situation" @id = "previous_housing_situation"
@copy_key = "lettings.household_situation.prevten.not_renewal"
@depends_on = [{ "is_renewal?" => false }] @depends_on = [{ "is_renewal?" => false }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_housing_situation_renewal" @id = "previous_housing_situation_renewal"
@copy_key = "lettings.household_situation.prevten.renewal"
@depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }] @depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_local_authority" @id = "previous_local_authority"
@copy_key = "lettings.household_situation.previous_local_authority"
@depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }] @depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousPostcode < ::Form::Page
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@depends_on = [{ "renewal" => 0 }] @depends_on = [{ "renewal" => 0 }]
@copy_key = "lettings.household_situation.previous_postcode"
end end
def questions def questions

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reason_for_leaving_last_settled_home" @id = "reason_for_leaving_last_settled_home"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home"
@depends_on = [{ "renewal" => 0 }] @depends_on = [{ "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Pa
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reason_for_leaving_last_settled_home_renewal" @id = "reason_for_leaving_last_settled_home_renewal"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home_renewal"
@depends_on = [{ "renewal" => 1 }] @depends_on = [{ "renewal" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral" @id = "referral"
@copy_key = "lettings.household_situation.referral.general_needs.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_prp" @id = "referral_prp"
@copy_key = "lettings.household_situation.referral.general_needs.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing" @id = "referral_supported_housing"
@copy_key = "lettings.household_situation.referral.supported_housing.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing_prp" @id = "referral_supported_housing_prp"
@copy_key = "lettings.household_situation.referral.supported_housing.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Homeless < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "homeless" @id = "homeless"
@check_answer_label = "Household homeless immediately before letting"
@header = "Did the household experience homelessness immediately before this letting?"
@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/layear.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Layear < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "layear" @id = "layear"
@check_answer_label = "Length of time in local authority area"
@header = "How long has the household continuously lived in the local authority area of the new letting?"
@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/letting_allocation.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "letting_allocation" @id = "letting_allocation"
@check_answer_label = "Allocation system"
@header = "How was this letting allocated?"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select all that apply."
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppcodenk" @id = "ppcodenk"
@check_answer_label = "" @copy_key = "lettings.household_situation.previous_postcode.ppcodenk"
@header = "Do you know the postcode of the household’s last settled accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "ppostcode_full" => [0] } @conditional_for = { "ppostcode_full" => [0] }
@hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] }

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppostcode_full" @id = "ppostcode_full"
@check_answer_label = "Postcode of household’s last settled accommodation" @copy_key = "lettings.household_situation.previous_postcode.ppostcode_full"
@header = "Postcode for the previous accommodation"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -13,7 +12,6 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
"value" => "Not known", "value" => "Not known",
}] }]
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } } @inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } }
@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]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "previous_la_known" @id = "previous_la_known"
@check_answer_label = "Do you know the local authority of the household’s last settled accommodation?" @copy_key = "lettings.household_situation.previous_local_authority.previous_la_known"
@header = "Do you know the local authority of the household’s last settled accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "prevloc" => [1] } @conditional_for = { "prevloc" => [1] }
@hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] }

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?" @copy_key = "lettings.household_situation.prevten.not_renewal"
@header = "Where was the household immediately before this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This is where the household was the night before they moved into this new let."
@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

5
app/models/form/lettings/questions/previous_tenure_renewal.rb

@ -2,12 +2,9 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?" @copy_key = "lettings.household_situation.prevten.renewal"
@header = "Where was the household immediately before this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us this letting is a renewal. We have removed some options because of this.<br><br>
This is where the household was the night before they moved into this new let."
@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

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

@ -2,12 +2,10 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevloc" @id = "prevloc"
@check_answer_label = "Location of household’s last settled accommodation" @copy_key = "lettings.household_situation.previous_local_authority.prevloc"
@header = "Select a local authority"
@type = "select" @type = "select"
@inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }] @inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }]
@check_answers_card_number = 0 @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 = 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]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reason < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reason" @id = "reason"
@check_answer_label = "Reason for leaving last settled home" @copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." : "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
@conditional_for = { @conditional_for = {
"reasonother" => [ "reasonother" => [
20, 20,

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reason" @id = "reason"
@check_answer_label = "Reason for leaving last settled home"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio" @type = "radio"
@copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@check_answers_card_number = 0 @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 = 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]
@conditional_for = { @conditional_for = {
"reasonother" => [ "reasonother" => [

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonable_preference_reason" @id = "reasonable_preference_reason"
@check_answer_label = "Reason for reasonable preference"
@header = "Why was the household given ‘reasonable preference’?"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select all that apply."
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonother" @id = "reasonother"
@check_answer_label = "" @copy_key = "lettings.household_situation.reason.#{@page.id}.reasonother"
@header = "What is the reason?"
@type = "text" @type = "text"
@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/reasonpref.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonpref" @id = "reasonpref"
@check_answer_label = "Household given reasonable preference"
@header = "Was the household given ‘reasonable preference’ by the local authority?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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 @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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Referral < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.general_needs.la"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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."
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.general_needs.prp"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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."
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.supported_housing.la"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us that you are a local authority. We have removed some options because of this."
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.supported_housing.prp"
@header = "What was the source of referral for this letting?"
@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/waityear.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "waityear" @id = "waityear"
@check_answer_label = "Length of time on local authority waiting list"
@header = form.start_year_after_2024? ? "How long has the household been on the local authority waiting list for the area of the new letting?" : "How long has the household been on the local authority waiting list for the new letting?"
@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

120
config/locales/forms/2023/lettings/household_situation.en.yml

@ -0,0 +1,120 @@
en:
forms:
2023:
lettings:
household_situation:
layear:
page_header: ""
check_answer_label: "Length of time in local authority area"
hint_text: ""
question_text: "How long has the household continuously lived in the local authority area of the new letting?"
waityear:
page_header: ""
check_answer_label: "Length of time on local authority waiting list"
hint_text: ""
question_text: "How long has the household been on the local authority waiting list for the new letting?"
reason:
reason_for_leaving_last_settled_home_renewal:
page_header: ""
reason:
check_answer_label: "Reason for leaving last settled home"
hint_text: "You told us this letting is a renewal. We have removed some options because of this."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: "Length of time on local authority waiting list"
hint_text: ""
question_text: "How long has the household been on the local authority waiting list for the new letting?"
reason_for_leaving_last_settled_home:
page_header: ""
reason:
check_answer_label: "Reason for leaving last settled home"
hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: ""
hint_text: ""
question_text: "What is the reason?"
prevten:
renewal:
page_header: ""
check_answer_label: "Where was the household immediately before this letting?"
hint_text: "You told us this letting is a renewal. We have removed some options because of this.<br><br>This is where the household was the night before they moved into this new let."
question_text: "Where was the household immediately before this letting?"
not_renewal:
page_header: ""
check_answer_label: "Where was the household immediately before this letting?"
hint_text: "This is where the household was the night before they moved into this new let."
question_text: "Where was the household immediately before this letting?"
homeless:
page_header: ""
check_answer_label: "Household homeless immediately before letting"
hint_text: ""
question_text: "Did the household experience homelessness immediately before this letting?"
previous_postcode:
page_header: ""
ppcodenk:
check_answer_label: ""
hint_text: "This is also known as the household’s ‘last settled home’."
question_text: "Do you know the postcode of the household’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of household’s last settled accommodation"
hint_text: ""
question_text: "Postcode for the previous accommodation"
previous_local_authority:
page_header: ""
previous_la_known:
check_answer_label: ""
hint_text: "This is also known as the household’s ‘last settled home’."
question_text: "Do you know the local authority of the household’s last settled accommodation?"
prevloc:
check_answer_label: "Location of household’s last settled accommodation"
hint_text: "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
question_text: "Select a local authority"
reasonpref:
page_header: ""
check_answer_label: "Household given reasonable preference"
hint_text: "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority."
question_text: "Was the household given ‘reasonable preference’ by the local authority?"
reasonable_preference_reason:
page_header: ""
check_answer_label: "Reason for reasonable preference"
hint_text: "Select all that apply."
question_text: "Why was the household given ‘reasonable preference’?"
letting_allocation:
page_header: ""
check_answer_label: "Allocation system"
hint_text: "Select all that apply."
question_text: "How was this letting allocated?"
referral:
supported_housing:
prp:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: ""
question_text: "What was the source of referral for this letting?"
la:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: "You told us that you are a local authority. We have removed some options because of this."
question_text: "What was the source of referral for this letting?"
general_needs:
prp:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: "You told us that the needs type is general needs. We have removed some options because of this."
question_text: "What was the source of referral for this letting?"
la:
page_header: ""
check_answer_label: "Source of referral for letting"
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."
question_text: "What was the source of referral for this letting?"

120
config/locales/forms/2024/lettings/household_situation.en.yml

@ -0,0 +1,120 @@
en:
forms:
2024:
lettings:
household_situation:
layear:
page_header: ""
check_answer_label: "Length of time in local authority area"
hint_text: ""
question_text: "How long has the household continuously lived in the local authority area of the new letting?"
waityear:
page_header: ""
check_answer_label: "Length of time on local authority waiting list"
hint_text: ""
question_text: "How long has the household been on the local authority waiting list for the area of the new letting?"
reason:
reason_for_leaving_last_settled_home_renewal:
page_header: ""
reason:
check_answer_label: "Reason for leaving last settled home"
hint_text: "You told us this letting is a renewal. We have removed some options because of this."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: "Length of time on local authority waiting list"
hint_text: ""
question_text: "How long has the household been on the local authority waiting list for the area of the new letting?"
reason_for_leaving_last_settled_home:
page_header: ""
reason:
check_answer_label: "Reason for leaving last settled home"
hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously."
question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
reasonother:
check_answer_label: ""
hint_text: ""
question_text: "What is the reason?"
prevten:
renewal:
page_header: ""
check_answer_label: "Where was the household immediately before this letting?"
hint_text: "You told us this letting is a renewal. We have removed some options because of this.<br><br>This is where the household was the night before they moved into this new let."
question_text: "Where was the household immediately before this letting?"
not_renewal:
page_header: ""
check_answer_label: "Where was the household immediately before this letting?"
hint_text: "This is where the household was the night before they moved into this new let."
question_text: "Where was the household immediately before this letting?"
homeless:
page_header: ""
check_answer_label: "Household homeless immediately before letting"
hint_text: ""
question_text: "Did the household experience homelessness immediately before this letting?"
previous_postcode:
page_header: ""
ppcodenk:
check_answer_label: ""
hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless."
question_text: "Do you know the postcode of the household’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of household’s last settled accommodation"
hint_text: ""
question_text: "Postcode for the previous accommodation"
previous_local_authority:
page_header: ""
previous_la_known:
check_answer_label: ""
hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless."
question_text: "Do you know the local authority of the household’s last settled accommodation?"
prevloc:
check_answer_label: "Location of household’s last settled accommodation"
hint_text: "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
question_text: "Select a local authority"
reasonpref:
page_header: ""
check_answer_label: "Household given reasonable preference"
hint_text: "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’."
question_text: "Was the household given ‘reasonable preference’ by the local authority?"
reasonable_preference_reason:
page_header: ""
check_answer_label: "Reason for reasonable preference"
hint_text: "Select all that apply."
question_text: "Why was the household given ‘reasonable preference’?"
letting_allocation:
page_header: ""
check_answer_label: "Allocation system"
hint_text: "Select all that apply."
question_text: "How was this letting allocated?"
referral:
supported_housing:
prp:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: ""
question_text: "What was the source of referral for this letting?"
la:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: "You told us that you are a local authority. We have removed some options because of this."
question_text: "What was the source of referral for this letting?"
general_needs:
prp:
page_header: ""
check_answer_label: "Source of referral for letting"
hint_text: "You told us that the needs type is general needs. We have removed some options because of this."
question_text: "What was the source of referral for this letting?"
la:
page_header: ""
check_answer_label: "Source of referral for letting"
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."
question_text: "What was the source of referral for this letting?"

2
spec/models/form/lettings/questions/homeless_spec.rb

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Questions::Homeless, type: :model do RSpec.describe Form::Lettings::Questions::Homeless, type: :model do
subject(:question) { described_class.new(nil, nil, page) } subject(:question) { described_class.new(nil, nil, page) }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4)))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), type: "lettings"), id: "household_situation")) }
it "has correct page" do it "has correct page" do
expect(question.page).to eq(page) expect(question.page).to eq(page)

2
spec/models/form/lettings/questions/reason_renewal_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do
let(:question_id) { nil } let(:question_id) { nil }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page, id: "reason_renewal") }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }

2
spec/models/form/lettings/questions/reason_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do
let(:question_id) { nil } let(:question_id) { nil }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page, id: "reason") }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }

Loading…
Cancel
Save