Browse Source

Merge branch 'main' into CLDC-3654-Copy-changes-sales-property-information-questions

pull/2694/head
Manny Dinssa 8 months ago committed by GitHub
parent
commit
34144561f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/models/form/lettings/pages/lead_tenant_age.rb
  2. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb
  3. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb
  4. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb
  5. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb
  6. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb
  7. 1
      app/models/form/lettings/pages/lead_tenant_nationality.rb
  8. 24
      app/models/form/lettings/pages/max_rent_value_check.rb
  9. 24
      app/models/form/lettings/pages/min_rent_value_check.rb
  10. 9
      app/models/form/lettings/pages/person_age.rb
  11. 1
      app/models/form/lettings/pages/person_known.rb
  12. 35
      app/models/form/lettings/pages/rent_value_check.rb
  13. 1
      app/models/form/lettings/pages/starter_tenancy_type.rb
  14. 1
      app/models/form/lettings/pages/tenancy_length.rb
  15. 1
      app/models/form/lettings/pages/tenancy_length_affordable_rent.rb
  16. 1
      app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb
  17. 1
      app/models/form/lettings/pages/tenancy_length_periodic.rb
  18. 1
      app/models/form/lettings/pages/tenancy_type.rb
  19. 8
      app/models/form/lettings/questions/age.rb
  20. 3
      app/models/form/lettings/questions/age1.rb
  21. 11
      app/models/form/lettings/questions/age1_known.rb
  22. 4
      app/models/form/lettings/questions/age_known.rb
  23. 2
      app/models/form/lettings/questions/declaration.rb
  24. 3
      app/models/form/lettings/questions/details_known.rb
  25. 4
      app/models/form/lettings/questions/ethnic_arab.rb
  26. 4
      app/models/form/lettings/questions/ethnic_asian.rb
  27. 4
      app/models/form/lettings/questions/ethnic_black.rb
  28. 3
      app/models/form/lettings/questions/ethnic_group.rb
  29. 4
      app/models/form/lettings/questions/ethnic_mixed.rb
  30. 4
      app/models/form/lettings/questions/ethnic_white.rb
  31. 10
      app/models/form/lettings/questions/gender_identity1.rb
  32. 3
      app/models/form/lettings/questions/hhmemb.rb
  33. 3
      app/models/form/lettings/questions/joint.rb
  34. 15
      app/models/form/lettings/questions/max_rent_value_check.rb
  35. 3
      app/models/form/lettings/questions/nationality.rb
  36. 3
      app/models/form/lettings/questions/nationality_all.rb
  37. 4
      app/models/form/lettings/questions/nationality_all_group.rb
  38. 10
      app/models/form/lettings/questions/person_gender_identity.rb
  39. 3
      app/models/form/lettings/questions/person_relationship.rb
  40. 3
      app/models/form/lettings/questions/person_working_situation.rb
  41. 4
      app/models/form/lettings/questions/rent_value_check.rb
  42. 3
      app/models/form/lettings/questions/sheltered.rb
  43. 4
      app/models/form/lettings/questions/starter_tenancy_type.rb
  44. 11
      app/models/form/lettings/questions/startertenancy.rb
  45. 4
      app/models/form/lettings/questions/tenancy_length.rb
  46. 11
      app/models/form/lettings/questions/tenancy_length_affordable_rent.rb
  47. 11
      app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb
  48. 4
      app/models/form/lettings/questions/tenancy_length_periodic.rb
  49. 4
      app/models/form/lettings/questions/tenancy_other.rb
  50. 4
      app/models/form/lettings/questions/tenancy_type.rb
  51. 3
      app/models/form/lettings/questions/working_situation1.rb
  52. 7
      app/models/form/lettings/subsections/household_characteristics.rb
  53. 3
      app/models/form/lettings/subsections/income_and_benefits.rb
  54. 6
      app/models/form/lettings/subsections/property_information.rb
  55. 1
      app/models/form/sales/pages/last_accommodation.rb
  56. 1
      app/models/form/sales/pages/last_accommodation_la.rb
  57. 2
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  58. 3
      app/models/form/sales/questions/buyer2_living_in.rb
  59. 7
      app/models/form/sales/questions/buyers_organisations.rb
  60. 4
      app/models/form/sales/questions/previous_la_known.rb
  61. 3
      app/models/form/sales/questions/previous_postcode.rb
  62. 4
      app/models/form/sales/questions/previous_postcode_known.rb
  63. 3
      app/models/form/sales/questions/previous_tenure_buyer2.rb
  64. 3
      app/models/form/sales/questions/prevloc.rb
  65. 8
      app/models/validations/soft_validations.rb
  66. 323
      config/locales/forms/2023/lettings/household_characteristics.en.yml
  67. 66
      config/locales/forms/2023/lettings/tenancy_information.en.yml
  68. 50
      config/locales/forms/2023/sales/household_situation.en.yml
  69. 66
      config/locales/forms/2024/lettings/tenancy_information.en.yml
  70. 50
      config/locales/forms/2024/sales/household_situation.en.yml
  71. 322
      config/locales/forms/2024/sales/lettings/household_characteristics.en.yml
  72. 33
      spec/models/form/lettings/pages/max_rent_value_check_spec.rb
  73. 42
      spec/models/form/lettings/pages/min_rent_value_check_spec.rb
  74. 27
      spec/models/form/lettings/pages/person_age_spec.rb
  75. 3
      spec/models/form/lettings/questions/age_spec.rb
  76. 32
      spec/models/form/lettings/questions/max_rent_value_check_spec.rb
  77. 32
      spec/models/form/lettings/questions/min_rent_value_check_spec.rb
  78. 2
      spec/models/form/lettings/questions/starter_tenancy_type_spec.rb
  79. 2
      spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb
  80. 2
      spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb
  81. 2
      spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb
  82. 2
      spec/models/form/lettings/questions/tenancy_length_spec.rb
  83. 2
      spec/models/form/lettings/questions/tenancy_other_spec.rb
  84. 2
      spec/models/form/lettings/questions/tenancy_type_spec.rb
  85. 42
      spec/models/form/lettings/subsections/household_characteristics_spec.rb
  86. 3
      spec/models/form/lettings/subsections/income_and_benefits_spec.rb
  87. 12
      spec/models/form/lettings/subsections/property_information_spec.rb
  88. 4
      spec/services/documentation_generator_spec.rb
  89. 6
      spec/services/merge/merge_organisations_service_spec.rb

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantAge < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_age" @id = "lead_tenant_age"
@copy_key = "lettings.household_characteristics.age1"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_arab" @id = "lead_tenant_ethnic_background_arab"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab"
@depends_on = [{ "ethnic_group" => 4 }] @depends_on = [{ "ethnic_group" => 4 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_asian" @id = "lead_tenant_ethnic_background_asian"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{ "ethnic_group" => 2 }] @depends_on = [{ "ethnic_group" => 2 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_black" @id = "lead_tenant_ethnic_background_black"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black"
@depends_on = [{ "ethnic_group" => 3 }] @depends_on = [{ "ethnic_group" => 3 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_mixed" @id = "lead_tenant_ethnic_background_mixed"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed"
@depends_on = [{ "ethnic_group" => 1 }] @depends_on = [{ "ethnic_group" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_white" @id = "lead_tenant_ethnic_background_white"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white"
@depends_on = [{ "ethnic_group" => 0 }] @depends_on = [{ "ethnic_group" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_nationality" @id = "lead_tenant_nationality"
@copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end

24
app/models/form/lettings/pages/max_rent_value_check.rb

@ -1,24 +0,0 @@
class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page
def initialize(id, hsh, subsection, check_answers_card_number: nil)
super(id, hsh, subsection)
@depends_on = [{ "rent_in_soft_max_range?" => true }]
@title_text = {
"translation" => "soft_validations.rent.outside_range_title",
"arguments" => [{
"key" => "brent",
"label" => true,
"i18n_template" => "brent",
}],
}
@informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "higher")
@check_answers_card_number = check_answers_card_number
end
def questions
@questions ||= [Form::Lettings::Questions::MaxRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)]
end
def interruption_screen_question_ids
%w[brent period startdate uprn postcode_full la beds rent_type needstype]
end
end

24
app/models/form/lettings/pages/min_rent_value_check.rb

@ -1,24 +0,0 @@
class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page
def initialize(id, hsh, subsection, check_answers_card_number: nil)
super(id, hsh, subsection)
@depends_on = [{ "rent_in_soft_min_range?" => true }]
@title_text = {
"translation" => "soft_validations.rent.outside_range_title",
"arguments" => [{
"key" => "brent",
"label" => true,
"i18n_template" => "brent",
}],
}
@informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "lower")
@check_answers_card_number = check_answers_card_number
end
def questions
@questions ||= [Form::Lettings::Questions::MinRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)]
end
def interruption_screen_question_ids
%w[brent period startdate uprn postcode_full la beds rent_type needstype]
end
end

9
app/models/form/lettings/pages/person_age.rb

@ -1,13 +1,12 @@
class Form::Lettings::Pages::PersonAge < ::Form::Page class Form::Lettings::Pages::PersonAge < ::Form::Page
def initialize(id, hsh, subsection, person_index:, person_type: "non_child") def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "person_#{person_index}_age_#{person_type}" @id = "person_#{person_index}_age"
@copy_key = "lettings.household_characteristics.age#{person_index}"
@person_index = person_index @person_index = person_index
@person_type = person_type
@depends_on = [ @depends_on = [
{ {
"details_known_#{person_index}" => 0, "details_known_#{person_index}" => 0,
"person_#{person_index}_child_relation?" => (person_type == "child"),
}, },
] ]
end end
@ -15,7 +14,7 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page
def questions def questions
@questions ||= [ @questions ||= [
Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index), Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index),
Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index, person_type: @person_type), Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index),
] ]
end end
end end

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

@ -2,7 +2,6 @@ class Form::Lettings::Pages::PersonKnown < ::Form::Page
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "person_#{person_index}_known" @id = "person_#{person_index}_known"
@header = "You’ve given us the details for #{person_index - 1} person in the household"
@depends_on = (person_index..8).map { |index| { "hhmemb" => index } } @depends_on = (person_index..8).map { |index| { "hhmemb" => index } }
@person_index = person_index @person_index = person_index
end end

35
app/models/form/lettings/pages/rent_value_check.rb

@ -0,0 +1,35 @@
class Form::Lettings::Pages::RentValueCheck < ::Form::Page
def initialize(id, hsh, subsection, check_answers_card_number: nil)
super(id, hsh, subsection)
@depends_on = [{ "rent_soft_validation_triggered?" => true }]
@title_text = {
"translation" => "soft_validations.rent.outside_range_title",
"arguments" => [
{
"key" => "brent",
"label" => true,
"i18n_template" => "brent",
},
],
}
@informative_text = {
"translation" => "soft_validations.rent.informative_text",
"arguments" => [
{
"key" => "rent_soft_validation_higher_or_lower_text",
"label" => false,
"i18n_template" => "higher_or_lower",
},
],
}
@check_answers_card_number = check_answers_card_number
end
def questions
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)]
end
def interruption_screen_question_ids
%w[brent period startdate uprn postcode_full la beds rent_type needstype]
end
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::StarterTenancyType < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "starter_tenancy_type" @id = "starter_tenancy_type"
@copy_key = "lettings.tenancy_information.tenancy.starter_tenancy_type"
@depends_on = [{ "starter_tenancy?" => true }] @depends_on = [{ "starter_tenancy?" => true }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLength < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length" @id = "tenancy_length"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length"
@depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthAffordableRent < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_affordable_rent" @id = "tenancy_length_affordable_rent"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_affordable_rent"
@depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => true, "needstype" => 1 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => true, "needstype" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthIntermediateRent < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_intermediate_rent" @id = "tenancy_length_intermediate_rent"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_intermediate_rent"
@depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => false, "needstype" => 1 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => false, "needstype" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthPeriodic < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_periodic" @id = "tenancy_length_periodic"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_periodic"
@depends_on = [{ "tenancy_type_periodic?" => true }] @depends_on = [{ "tenancy_type_periodic?" => true }]
end end

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

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

8
app/models/form/lettings/questions/age.rb

@ -1,9 +1,8 @@
class Form::Lettings::Questions::Age < ::Form::Question class Form::Lettings::Questions::Age < ::Form::Question
def initialize(id, hsh, page, person_index:, person_type:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "age#{person_index}" @id = "age#{person_index}"
@check_answer_label = "Person #{person_index}’s age" @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, "value" => "Not known" }] @inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, "value" => "Not known" }]
@ -13,7 +12,6 @@ class Form::Lettings::Questions::Age < ::Form::Question
@step = 1 @step = 1
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number
@person_type = person_type
@hint_text = hint_text @hint_text = hint_text
end end
@ -31,8 +29,6 @@ class Form::Lettings::Questions::Age < ::Form::Question
def hint_text def hint_text
if form.start_year_after_2024? if form.start_year_after_2024?
"Answer 1 for children aged under 1 year old" "Answer 1 for children aged under 1 year old"
elsif @person_type == "child"
"For a child under 1, enter 1"
end end
end end
end end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1" @id = "age1"
@check_answer_label = "Lead tenant’s age" @copy_key = "lettings.household_characteristics.age1.age1"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }] @inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }]

11
app/models/form/lettings/questions/age1_known.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1_known" @id = "age1_known"
@check_answer_label = "" @copy_key = "lettings.household_characteristics.age1.age1_known"
@header = "Do you know the lead tenant’s age?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -14,13 +13,5 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze
def hint_text
if form.start_year_after_2024?
"The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest."
else
"The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze
end end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "age#{person_index}_known" @id = "age#{person_index}_known"
@check_answer_label = "" @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}_known"
@header = "Do you know person #{person_index}’s age?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "age#{person_index}" => [0] } @conditional_for = { "age#{person_index}" => [0] }
@hidden_in_check_answers = { @hidden_in_check_answers = {

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "declaration" @id = "declaration"
@check_answer_label = "Tenant has seen the privacy notice"
@header = "Declaration"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024? @check_answers_card_number = 0 unless form.start_year_after_2024?
@top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant" @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant"

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::DetailsKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "details_known_#{person_index}" @id = "details_known_#{person_index}"
@check_answer_label = "Details known for person #{person_index}"
@header = "Do you know details for person #{person_index}?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = "You must provide details for everyone in the household if you know them."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
end end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab"
@header = "Which of the following best describes the lead tenant’s Arab background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/ethnic_asian.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian"
@header = "Which of the following best describes the lead tenant’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/ethnic_black.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black"
@header = "Which of the following best describes the lead tenant’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/ethnic_group.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic_group" @id = "ethnic_group"
@check_answer_label = "Lead tenant’s ethnic group"
@header = "What is the lead tenant’s ethnic group?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/ethnic_mixed.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed"
@header = "Which of the following best describes the lead tenant’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/ethnic_white.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white"
@header = "Which of the following best describes the lead tenant’s White background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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

10
app/models/form/lettings/questions/gender_identity1.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex1" @id = "sex1"
@check_answer_label = "Lead tenant’s gender identity"
@header = "Which of these best describes the lead tenant’s gender identity?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -18,13 +16,5 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question
"R" => { "value" => "Tenant prefers not to say" }, "R" => { "value" => "Tenant prefers not to say" },
}.freeze }.freeze
def hint_text
if form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
else
"The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze
end end

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

@ -2,14 +2,11 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hhmemb" @id = "hhmemb"
@check_answer_label = "Number of household members"
@header = "How many people live in the household for this letting?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@max = 8 @max = 8
@min = 1 @min = 1
@hint_text = "You can provide details for a maximum of 8 people."
@step = 1 @step = 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]
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Joint < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "joint" @id = "joint"
@check_answer_label = "Is this a joint tenancy?"
@header = "Is this a joint tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is where two or more people are named on the tenancy agreement" : ""
@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

15
app/models/form/lettings/questions/max_rent_value_check.rb

@ -1,15 +0,0 @@
class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "rent_value_check"
@check_answer_label = "Total rent confirmation"
@header = "Are you sure this is correct?"
@type = "interruption_screen"
@hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "higher")
@check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze
end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Nationality < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "national" @id = "national"
@check_answer_label = "Lead tenant’s nationality"
@header = "What is the nationality of the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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/nationality_all.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "nationality_all" @id = "nationality_all"
@check_answer_label = "Lead tenant’s nationality" @copy_key = "lettings.household_characteristics.nationality_all.nationality_all"
@header = "Enter a nationality"
@type = "select" @type = "select"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "nationality_all_group" @id = "nationality_all_group"
@check_answer_label = "Lead tenant’s nationality" @copy_key = "lettings.household_characteristics.nationality_all.nationality_all_group"
@header = "What is the nationality of the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter."
@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]
@conditional_for = { "nationality_all" => [12] } @conditional_for = { "nationality_all" => [12] }

10
app/models/form/lettings/questions/person_gender_identity.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "sex#{person_index}" @id = "sex#{person_index}"
@check_answer_label = "Person #{person_index}’s gender identity"
@header = "Which of these best describes person #{person_index}’s gender identity?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -19,14 +17,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question
"R" => { "value" => "Person prefers not to say" }, "R" => { "value" => "Person prefers not to say" },
}.freeze }.freeze
def hint_text
if form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
else
""
end
end
def question_number def question_number
base_question_number = case form.start_date.year base_question_number = case form.start_date.year
when 2023 when 2023

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "relat#{person_index}" @id = "relat#{person_index}"
@check_answer_label = "Person #{person_index}’s relationship to the lead tenant"
@header = "What is person #{person_index}’s relationship to the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@answer_options = answer_options @answer_options = answer_options
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "ecstat#{person_index}" @id = "ecstat#{person_index}"
@check_answer_label = "Person #{person_index}’s working situation"
@header = "Which of these best describes person #{person_index}’s working situation?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number
@answer_options = answer_options @answer_options = answer_options

4
app/models/form/lettings/questions/min_rent_value_check.rb → app/models/form/lettings/questions/rent_value_check.rb

@ -1,11 +1,11 @@
class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question class Form::Lettings::Questions::RentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "rent_value_check" @id = "rent_value_check"
@check_answer_label = "Total rent confirmation" @check_answer_label = "Total rent confirmation"
@header = "Are you sure this is correct?" @header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "lower") @hint_text = I18n.t("soft_validations.rent.hint_text")
@check_answers_card_number = check_answers_card_number @check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sheltered" @id = "sheltered"
@check_answer_label = "Is this letting in sheltered accommodation?"
@header = "Is this letting in sheltered accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.</br></br>Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission."
@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/starter_tenancy_type.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancy" @id = "tenancy"
@check_answer_label = form.start_year_after_2024? ? "Type of main tenancy after the starter or introductory period has ended" : "Type of main tenancy after the starter period has ended" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy"
@header = form.start_year_after_2024? ? "What is the type of tenancy after the starter or introductory period has ended?" : "What is the type of tenancy after the starter period has ended?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’."
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@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

11
app/models/form/lettings/questions/startertenancy.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "startertenancy" @id = "startertenancy"
@check_answer_label = "Is this a starter or introductory tenancy?"
@header = "Is this a starter tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -12,14 +10,5 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question
ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze
def hint_text
if form.start_year_after_2024?
"If the tenancy has an ‘introductory period’ answer ‘yes’.<br><br>
You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy."
else
"This is also known as an ‘introductory period’."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze
end end

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

@ -2,14 +2,12 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@max = 150 @max = 150
@min = 0 @min = 0
@hint_text = "Do not include the starter or introductory period."
@step = 1 @step = 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]
end end

11
app/models/form/lettings/questions/tenancy_length_affordable_rent.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question
@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
def hint_text
if form.start_year_after_2024?
"Do not include the starter or introductory period.</br>The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years."
else
"Do not include the starter or introductory period.</br>The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze
end end

11
app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio
@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
def hint_text
if form.start_year_after_2024?
"Do not include the starter or introductory period.</br>The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year."
else
"Do not include the starter or introductory period.</br>The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze
end end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of periodic tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the periodic tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -11,7 +10,6 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question
@min = 0 @min = 0
@step = 1 @step = 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]
@hint_text = "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue"
end end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancyother" @id = "tenancyother"
@check_answer_label = "" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancyother"
@header = "Please state the tenancy type"
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancy" @id = "tenancy"
@check_answer_label = "Type of main tenancy" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy"
@header = "What is the type of tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@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/working_situation1.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ecstat1" @id = "ecstat1"
@check_answer_label = "Lead tenant’s working situation"
@header = "Which of these best describes the lead tenant’s working situation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
@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

7
app/models/form/lettings/subsections/household_characteristics.rb

@ -35,7 +35,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2), person_index: 2),
@ -56,7 +55,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3), person_index: 3),
@ -77,7 +75,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4), person_index: 4),
@ -98,7 +95,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5), person_index: 5),
@ -119,7 +115,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6), person_index: 6),
@ -140,7 +135,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7), person_index: 7),
@ -161,7 +155,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8, person_type: "child"),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8), person_index: 8),

3
app/models/form/lettings/subsections/income_and_benefits.rb

@ -24,8 +24,7 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection
Form::Lettings::Pages::RentBiWeekly.new(nil, nil, self), Form::Lettings::Pages::RentBiWeekly.new(nil, nil, self),
Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self), Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self),
Form::Lettings::Pages::RentMonthly.new(nil, nil, self), Form::Lettings::Pages::RentMonthly.new(nil, nil, self),
Form::Lettings::Pages::MinRentValueCheck.new("brent_min_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::RentValueCheck.new("brent_rent_value_check", nil, self, check_answers_card_number: 0),
Form::Lettings::Pages::MaxRentValueCheck.new("brent_max_rent_value_check", nil, self, check_answers_card_number: 0),
Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self),

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

@ -10,8 +10,7 @@ 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::RentValueCheck.new("local_authority_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),
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,8 +20,7 @@ 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::RentValueCheck.new("beds_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),
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),
Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self),

1
app/models/form/sales/pages/last_accommodation.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation" @id = "last_accommodation"
@copy_key = "sales.household_situation.last_accommodation"
end end
def questions def questions

1
app/models/form/sales/pages/last_accommodation_la.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation_la" @id = "last_accommodation_la"
@copy_key = "sales.household_situation.last_accommodation_la"
@depends_on = [{ @depends_on = [{
"is_previous_la_inferred" => false, "is_previous_la_inferred" => false,
}] }]

2
app/models/form/sales/questions/buyer1_previous_tenure.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Buyer 1’s previous tenure"
@header = "What was buyer 1’s previous tenure?"
@type = "radio" @type = "radio"
@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]

3
app/models/form/sales/questions/buyer2_living_in.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buy2living" @id = "buy2living"
@check_answer_label = "Buyer 2 living at the same address"
@header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
@type = "radio" @type = "radio"
@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

7
app/models/form/sales/questions/buyers_organisations.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buyers_organisations" @id = "buyers_organisations"
@check_answer_label = "Organisations buyers were registered with"
@header = "What organisations were the buyers registered with?"
@type = "checkbox" @type = "checkbox"
@hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
@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
@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
} }
end end
def unanswered_error_message
"At least one option must be selected of these four"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze
end end

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

@ -2,11 +2,9 @@ class Form::Sales::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 = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known"
@header = "Do you know the local authority of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_postcode.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::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 buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppostcode_full"
@header = "Postcode"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

4
app/models/form/sales/questions/previous_postcode_known.rb

@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppcodenk" @id = "ppcodenk"
@check_answer_label = "Buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppcodenk"
@header = "Do you know the postcode of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @conditional_for = {
"ppostcode_full" => [0], "ppostcode_full" => [0],
} }
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_tenure_buyer2.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevtenbuy2" @id = "prevtenbuy2"
@check_answer_label = "Buyer 2’s previous tenure"
@header = "What was buyer 2’s previous tenure?"
@type = "radio" @type = "radio"
@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/sales/questions/prevloc.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevloc" @id = "prevloc"
@check_answer_label = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.prevloc"
@header = "Select a local authority"
@type = "select" @type = "select"
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

8
app/models/validations/soft_validations.rb

@ -27,6 +27,14 @@ module Validations::SoftValidations
weekly_net_income.between?(applicable_income_range.hard_min, applicable_income_range.soft_min) weekly_net_income.between?(applicable_income_range.hard_min, applicable_income_range.soft_min)
end end
def rent_soft_validation_triggered?
rent_in_soft_min_range? || rent_in_soft_max_range?
end
def rent_soft_validation_higher_or_lower_text
rent_in_soft_min_range? ? "lower" : "higher"
end
def rent_in_soft_min_range? def rent_in_soft_min_range?
return unless brent && weekly_value(brent) && startdate return unless brent && weekly_value(brent) && startdate

323
config/locales/forms/2023/lettings/household_characteristics.en.yml

@ -0,0 +1,323 @@
en:
forms:
2023:
lettings:
household_characteristics:
declaration:
page_header: "Ministry of Housing, Communities and Local Government privacy notice"
check_answer_label: "Tenant has seen the privacy notice"
hint_text: ""
question_text: "Declaration"
hhmemb:
page_header: ""
check_answer_label: "Number of household members"
hint_text: "You can provide details for a maximum of 8 people."
question_text: "How many people live in the household for this letting?"
age1:
page_header: ""
age1_known:
check_answer_label: ""
hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Do you know the lead tenant’s age?"
age1:
check_answer_label: "Lead tenant’s age"
hint_text: ""
question_text: "Age"
sex1:
page_header: ""
check_answer_label: "Lead tenant’s gender identity"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of these best describes the lead tenant’s gender identity?"
ethnic_group:
page_header: ""
check_answer_label: "Lead tenant’s ethnic group"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "What is the lead tenant’s ethnic group?"
ethnic:
ethnic_background_black:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of the following best describes the lead tenant’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of the following best describes lead tenant’s White background?"
national:
page_header: ""
check_answer_label: "Lead tenant’s nationality"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "What is the nationality of the lead tenant?"
ecstat1:
page_header: ""
check_answer_label: "Lead tenant’s working situation"
hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest."
question_text: "Which of these best describes the lead tenant’s working situation?"
details_known_2:
page_header: "You’ve given us the details for 1 person in the household"
check_answer_label: "Details known for person 2"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 2?"
relat2:
page_header: ""
check_answer_label: "Person 2’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 2’s relationship to the lead tenant?"
age2:
page_header: ""
age2_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 2’s age?"
age2:
check_answer_label: "Person 2’s age"
hint_text: ""
question_text: "Age"
sex2:
page_header: ""
check_answer_label: "Person 2’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 2’s gender identity?"
ecstat2:
page_header: ""
check_answer_label: "Person 2’s working situation"
hint_text: ""
question_text: "Which of these best describes person 2’s working situation?"
details_known_3:
page_header: "You’ve given us the details for 2 people in the household"
check_answer_label: "Details known for person 3"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 3?"
relat3:
page_header: ""
check_answer_label: "Person 3’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 3’s relationship to the lead tenant?"
age3:
page_header: ""
age3_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
check_answer_label: "Person 3’s age"
hint_text: ""
question_text: "Age"
sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 3’s gender identity?"
ecstat3:
page_header: ""
check_answer_label: "Person 3’s working situation"
hint_text: ""
question_text: "Which of these best describes person 3’s working situation?"
details_known_4:
page_header: "You’ve given us the details for 3 people in the household"
check_answer_label: "Details known for person 4"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 4?"
relat4:
page_header: ""
check_answer_label: "Person 4’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 4’s relationship to the lead tenant?"
age4:
page_header: ""
age4_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
check_answer_label: "Person 4’s age"
hint_text: ""
question_text: "Age"
sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 4’s gender identity?"
ecstat4:
page_header: ""
check_answer_label: "Person 4’s working situation"
hint_text: ""
question_text: "Which of these best describes person 4’s working situation?"
details_known_5:
page_header: "You’ve given us the details for 4 people in the household"
check_answer_label: "Details known for person 5"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 5?"
relat5:
page_header: ""
check_answer_label: "Person 5’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 5’s relationship to the lead tenant?"
age5:
page_header: ""
age5_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
check_answer_label: "Person 5’s age"
hint_text: ""
question_text: "Age"
sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 5’s gender identity?"
ecstat5:
page_header: ""
check_answer_label: "Person 5’s working situation"
hint_text: ""
question_text: "Which of these best describes person 5’s working situation?"
details_known_6:
page_header: "You’ve given us the details for 5 people in the household"
check_answer_label: "Details known for person 6"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 6?"
relat6:
page_header: ""
check_answer_label: "Person 6’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 6’s relationship to the lead tenant?"
age6:
page_header: ""
age6_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
check_answer_label: "Person 6’s age"
hint_text: ""
question_text: "Age"
sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 6’s gender identity?"
ecstat6:
page_header: ""
check_answer_label: "Person 6’s working situation"
hint_text: ""
question_text: "Which of these best describes person 6’s working situation?"
details_known_7:
page_header: "You’ve given us the details for 6 people in the household"
check_answer_label: "Details known for person 7"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 7?"
relat7:
page_header: ""
check_answer_label: "Person 7’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 7’s relationship to the lead tenant?"
age7:
page_header: ""
age7_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 7’s age?"
age7:
check_answer_label: "Person 7’s age"
hint_text: ""
question_text: "Age"
sex7:
page_header: ""
check_answer_label: "Person 7’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 7’s gender identity?"
ecstat7:
page_header: ""
check_answer_label: "Person 7’s working situation"
hint_text: ""
question_text: "Which of these best describes person 7’s working situation?"
details_known_8:
page_header: "You’ve given us the details for 7 people in the household"
check_answer_label: "Details known for person 8"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 8?"
relat8:
page_header: ""
check_answer_label: "Person 8’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 8’s relationship to the lead tenant?"
age8:
page_header: ""
age8_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 8’s age?"
age8:
check_answer_label: "Person 8’s age"
hint_text: ""
question_text: "Age"
sex8:
page_header: ""
check_answer_label: "Person 8’s gender identity"
hint_text: ""
question_text: "Which of these best describes person 8’s gender identity?"
ecstat8:
page_header: ""
check_answer_label: "Person 8’s working situation"
hint_text: ""
question_text: "Which of these best describes person 8’s working situation?"

66
config/locales/forms/2023/lettings/tenancy_information.en.yml

@ -0,0 +1,66 @@
en:
forms:
2023:
lettings:
tenancy_information:
joint:
page_header: ""
check_answer_label: "Is this a joint tenancy?"
hint_text: ""
question_text: "Is this a joint tenancy?"
startertenancy:
page_header: ""
check_answer_label: "Is this a starter or introductory tenancy?"
hint_text: "This is also known as an ‘introductory period’."
question_text: "Is this a starter tenancy?"
tenancy:
tenancy_type:
page_header: ""
tenancy:
check_answer_label: "Type of main tenancy"
hint_text: ""
question_text: "What is the type of tenancy?"
tenancyother:
check_answer_label: ""
hint_text: ""
question_text: "Please state the tenancy type"
starter_tenancy_type:
page_header: ""
tenancy:
check_answer_label: "Type of main tenancy after the starter period has ended"
hint_text: "This is also known as an ‘introductory period’."
question_text: "What is the type of tenancy after the starter period has ended?"
tenancyother:
check_answer_label: ""
hint_text: ""
question_text: "Please state the tenancy type"
tenancylength:
tenancy_length:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_affordable_rent:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period.</br>The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_intermediate_rent:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period.</br>The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_periodic:
page_header: ""
check_answer_label: "Length of periodic tenancy"
hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue"
question_text: "What is the length of the periodic tenancy to the nearest year?"
sheltered:
page_header: ""
check_answer_label: "Is this letting in sheltered accommodation?"
hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.</br></br>Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission."
question_text: "Is this letting in sheltered accommodation?"

50
config/locales/forms/2023/sales/household_situation.en.yml

@ -0,0 +1,50 @@
en:
forms:
2023:
sales:
household_situation:
prevten:
page_header: ""
check_answer_label: "Buyer 1’s previous tenure"
hint_text: ""
question_text: "What was buyer 1’s previous tenure?"
last_accommodation:
page_header: ""
ppcodenk:
check_answer_label: "Buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the postcode of buyer 1’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Postcode"
last_accommodation_la:
page_header: ""
previous_la_known:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the local authority of buyer 1’s last settled accommodation?"
prevloc:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Select a local authority"
buyers_organisations:
page_header: ""
check_answer_label: "Organisations buyers were registered with"
hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
question_text: "What organisations were the buyers registered with?"
buy2living:
page_header: ""
check_answer_label: "Buyer 2 living at the same address"
hint_text: ""
header: "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
prevtenbuy2:
page_header: ""
check_answer_label: "Buyer 2’s previous tenure"
hint_text: ""
question_text: "What was buyer 2’s previous tenure?"

66
config/locales/forms/2024/lettings/tenancy_information.en.yml

@ -0,0 +1,66 @@
en:
forms:
2024:
lettings:
tenancy_information:
joint:
page_header: ""
check_answer_label: "Is this a joint tenancy?"
hint_text: "This is where two or more people are named on the tenancy agreement"
question_text: "Is this a joint tenancy?"
startertenancy:
page_header: ""
check_answer_label: "Is this a starter or introductory tenancy?"
hint_text: "If the tenancy has an ‘introductory period’ answer ‘yes’.<br><br>You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy."
question_text: "Is this a starter tenancy?"
tenancy:
tenancy_type:
page_header: ""
tenancy:
check_answer_label: "Type of main tenancy"
hint_text: ""
question_text: "What is the type of tenancy?"
tenancyother:
check_answer_label: ""
hint_text: ""
question_text: "Please state the tenancy type"
starter_tenancy_type:
page_header: ""
tenancy:
check_answer_label: "Type of main tenancy after the starter or introductory period has ended"
hint_text: ""
question_text: "What is the type of tenancy after the starter or introductory period has ended?"
tenancyother:
check_answer_label: ""
hint_text: ""
question_text: "Please state the tenancy type"
tenancylength:
tenancy_length:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_affordable_rent:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period.</br>The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_intermediate_rent:
page_header: ""
check_answer_label: "Length of fixed-term tenancy"
hint_text: "Do not include the starter or introductory period.</br>The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year."
question_text: "What is the length of the fixed-term tenancy to the nearest year?"
tenancy_length_periodic:
page_header: ""
check_answer_label: "Length of periodic tenancy"
hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue"
question_text: "What is the length of the periodic tenancy to the nearest year?"
sheltered:
page_header: ""
check_answer_label: "Is this letting in sheltered accommodation?"
hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.</br></br>Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission."
question_text: "Is this letting in sheltered accommodation?"

50
config/locales/forms/2024/sales/household_situation.en.yml

@ -0,0 +1,50 @@
en:
forms:
2024:
sales:
household_situation:
prevten:
page_header: ""
check_answer_label: "Buyer 1’s previous tenure"
hint_text: ""
question_text: "What was buyer 1’s previous tenure?"
last_accommodation:
page_header: ""
ppcodenk:
check_answer_label: "Buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the postcode of buyer 1’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Postcode"
last_accommodation_la:
page_header: ""
previous_la_known:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the local authority of buyer 1’s last settled accommodation?"
prevloc:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Select a local authority"
buyers_organisations:
page_header: ""
check_answer_label: "Organisations buyers were registered with"
hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
question_text: "What organisations were the buyers registered with?"
buy2living:
page_header: ""
check_answer_label: "Buyer 2 living at the same address"
hint_text: ""
question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
prevtenbuy2:
page_header: ""
check_answer_label: "Buyer 2’s previous tenure"
hint_text: ""
question_text: "What was buyer 2’s previous tenure?"

322
config/locales/forms/2024/sales/lettings/household_characteristics.en.yml

@ -0,0 +1,322 @@
en:
forms:
2024:
lettings:
household_characteristics:
hhmemb:
page_header: ""
check_answer_label: "Number of household members"
hint_text: "You can provide details for a maximum of 8 people."
question_text: "How many people live in the household for this letting?"
age1:
page_header: ""
age1_known:
check_answer_label: ""
hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest."
question_text: "Do you know the lead tenant’s age?"
age1:
check_answer_label: "Lead tenant’s age"
hint_text: ""
question_text: "Age"
sex1:
page_header: ""
check_answer_label: "Lead tenant’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes the lead tenant’s gender identity?"
ethnic_group:
page_header: ""
check_answer_label: "Lead tenant’s ethnic group"
hint_text: ""
question_text: "What is the lead tenant’s ethnic group?"
ethnic:
ethnic_background_black:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes the lead tenant’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Lead tenant’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes lead tenant’s White background?"
nationality_all:
page_header: ""
nationality_all:
check_answer_label: "Lead tenant’s nationality"
hint_text: ""
question_text: "Enter a nationality"
nationality_all_group:
check_answer_label: "Lead tenant’s nationality"
hint_text: "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter."
question_text: "What is the nationality of the lead tenant?"
ecstat1:
page_header: ""
check_answer_label: "Lead tenant’s working situation"
hint_text: ""
question_text: "Which of these best describes the lead tenant’s working situation?"
details_known_2:
page_header: "You’ve given us the details for 1 person in the household"
check_answer_label: "Details known for person 2"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 2?"
relat2:
page_header: ""
check_answer_label: "Person 2’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 2’s relationship to the lead tenant?"
age2:
page_header: ""
age2_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 2’s age?"
age2:
check_answer_label: "Person 2’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex2:
page_header: ""
check_answer_label: "Person 2’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 2’s gender identity?"
ecstat2:
page_header: ""
check_answer_label: "Person 2’s working situation"
hint_text: ""
question_text: "Which of these best describes person 2’s working situation?"
details_known_3:
page_header: "You’ve given us the details for 2 people in the household"
check_answer_label: "Details known for person 3"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 3?"
relat3:
page_header: ""
check_answer_label: "Person 3’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 3’s relationship to the lead tenant?"
age3:
page_header: ""
age3_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
check_answer_label: "Person 3’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 3’s gender identity?"
ecstat3:
page_header: ""
check_answer_label: "Person 3’s working situation"
hint_text: ""
question_text: "Which of these best describes person 3’s working situation?"
details_known_4:
page_header: "You’ve given us the details for 3 people in the household"
check_answer_label: "Details known for person 4"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 4?"
relat4:
page_header: ""
check_answer_label: "Person 4’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 4’s relationship to the lead tenant?"
age4:
page_header: ""
age4_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
check_answer_label: "Person 4’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 4’s gender identity?"
ecstat4:
page_header: ""
check_answer_label: "Person 4’s working situation"
hint_text: ""
question_text: "Which of these best describes person 4’s working situation?"
details_known_5:
page_header: "You’ve given us the details for 4 people in the household"
check_answer_label: "Details known for person 5"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 5?"
relat5:
page_header: ""
check_answer_label: "Person 5’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 5’s relationship to the lead tenant?"
age5:
page_header: ""
age5_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
check_answer_label: "Person 5’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 5’s gender identity?"
ecstat5:
page_header: ""
check_answer_label: "Person 5’s working situation"
hint_text: ""
question_text: "Which of these best describes person 5’s working situation?"
details_known_6:
page_header: "You’ve given us the details for 5 people in the household"
check_answer_label: "Details known for person 6"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 6?"
relat6:
page_header: ""
check_answer_label: "Person 6’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 6’s relationship to the lead tenant?"
age6:
page_header: ""
age6_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
check_answer_label: "Person 6’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 6’s gender identity?"
ecstat6:
page_header: ""
check_answer_label: "Person 6’s working situation"
hint_text: ""
question_text: "Which of these best describes person 6’s working situation?"
details_known_7:
page_header: "You’ve given us the details for 6 people in the household"
check_answer_label: "Details known for person 7"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 7?"
relat7:
page_header: ""
check_answer_label: "Person 7’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 7’s relationship to the lead tenant?"
age7:
page_header: ""
age7_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 7’s age?"
age7:
check_answer_label: "Person 7’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex7:
page_header: ""
check_answer_label: "Person 7’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 7’s gender identity?"
ecstat7:
page_header: ""
check_answer_label: "Person 7’s working situation"
hint_text: ""
question_text: "Which of these best describes person 7’s working situation?"
details_known_8:
page_header: "You’ve given us the details for 7 people in the household"
check_answer_label: "Details known for person 8"
hint_text: "You must provide details for everyone in the household if you know them."
question_text: "Do you know details for person 8?"
relat8:
page_header: ""
check_answer_label: "Person 8’s relationship to the lead tenant"
hint_text: ""
question_text: "What is person 8’s relationship to the lead tenant?"
age8:
page_header: ""
age8_known:
check_answer_label: ""
hint_text: ""
question_text: "Do you know person 8’s age?"
age8:
check_answer_label: "Person 8’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex8:
page_header: ""
check_answer_label: "Person 8’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes person 8’s gender identity?"
ecstat8:
page_header: ""
check_answer_label: "Person 8’s working situation"
hint_text: ""
question_text: "Which of these best describes person 8’s working situation?"

33
spec/models/form/lettings/pages/max_rent_value_check_spec.rb

@ -1,33 +0,0 @@
require "rails_helper"
RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { "max_rent_value_check" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[rent_value_check])
end
it "has the correct id" do
expect(page.id).to eq("max_rent_value_check")
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{ "rent_in_soft_max_range?" => true }])
end
it "has the correct title_text" do
expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }], "translation" => "soft_validations.rent.outside_range_title" })
end
it "has the correct interruption_screen_question_ids" do
expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype])
end
end

42
spec/models/form/lettings/pages/min_rent_value_check_spec.rb

@ -1,42 +0,0 @@
require "rails_helper"
RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { "min_rent_value_check" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has the correct description" do
expect(page.description).to be nil
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[rent_value_check])
end
it "has the correct id" do
expect(page.id).to eq("min_rent_value_check")
end
it "has correct depends_on" do
expect(page.depends_on).to eq(
[{ "rent_in_soft_min_range?" => true }],
)
end
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.rent.outside_range_title",
"arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }],
})
end
it "has the correct interruption_screen_question_ids" do
expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype])
end
end

27
spec/models/form/lettings/pages/person_age_spec.rb

@ -1,12 +1,11 @@
require "rails_helper" require "rails_helper"
RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do
subject(:page) { described_class.new(nil, page_definition, subsection, person_index:, person_type:) } subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) }
let(:person_index) { 2 } let(:person_index) { 2 }
let(:person_type) { "non_child" }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
@ -21,33 +20,17 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do
expect(page.questions.map(&:id)).to eq(%w[age2_known age2]) expect(page.questions.map(&:id)).to eq(%w[age2_known age2])
end end
context "when child" do
let(:person_type) { "child" }
it "has the correct id" do it "has the correct id" do
expect(page.id).to eq("person_2_age_child") expect(page.id).to eq("person_2_age")
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq( expect(page.depends_on).to eq(
[{ "details_known_2" => 0, "person_2_child_relation?" => true }], [{ "details_known_2" => 0 }],
) )
end end
end end
context "when not child" do
it "has the correct id" do
expect(page.id).to eq("person_2_age_non_child")
end
it "has correct depends_on" do
expect(page.depends_on).to eq(
[{ "details_known_2" => 0, "person_2_child_relation?" => false }],
)
end
end
end
context "with person 3" do context "with person 3" do
let(:person_index) { 3 } let(:person_index) { 3 }
@ -56,12 +39,12 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do
end end
it "has the correct id" do it "has the correct id" do
expect(page.id).to eq("person_3_age_non_child") expect(page.id).to eq("person_3_age")
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq( expect(page.depends_on).to eq(
[{ "details_known_3" => 0, "person_3_child_relation?" => false }], [{ "details_known_3" => 0 }],
) )
end end
end end

3
spec/models/form/lettings/questions/age_spec.rb

@ -1,12 +1,11 @@
require "rails_helper" require "rails_helper"
RSpec.describe Form::Lettings::Questions::Age, type: :model do RSpec.describe Form::Lettings::Questions::Age, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, person_index:, person_type:) } subject(:question) { described_class.new(nil, question_definition, page, person_index:) }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) }
let(:person_index) { 2 } let(:person_index) { 2 }
let(:person_type) { "non_child" }
it "has correct page" do it "has correct page" do
expect(question.page).to eq(page) expect(question.page).to eq(page)

32
spec/models/form/lettings/questions/max_rent_value_check_spec.rb

@ -1,32 +0,0 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) }
let(:question_definition) { nil }
let(:check_answers_card_number) { nil }
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("rent_value_check")
end
it "has the correct type" do
expect(question.type).to eq("interruption_screen")
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
})
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] })
end
end

32
spec/models/form/lettings/questions/min_rent_value_check_spec.rb

@ -1,32 +0,0 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) }
let(:question_definition) { nil }
let(:check_answers_card_number) { nil }
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("rent_value_check")
end
it "has the correct type" do
expect(question.type).to eq("interruption_screen")
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
})
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] })
end
end

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

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, 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: "starter_tenancy_type") }
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/tenancy_length_affordable_rent_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo
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: "affordable_tenancy_length") }
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/tenancy_length_intermediate_rent_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: :
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: "intermediate_tenancy_length") }
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/tenancy_length_periodic_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, 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, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "periodic_tenancy_length") }
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/tenancy_length_spec.rb

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do RSpec.describe Form::Lettings::Questions::TenancyLength, 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, 1)))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_length") }
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/tenancy_other_spec.rb

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do RSpec.describe Form::Lettings::Questions::TenancyOther, 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, 1)))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_type") }
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/tenancy_type_spec.rb

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do RSpec.describe Form::Lettings::Questions::TenancyType, 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) } let(:page) { instance_double(Form::Page, id: "tenancy_type") }
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)) }

42
spec/models/form/lettings/subsections/household_characteristics_spec.rb

@ -49,8 +49,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_lead_tenant_over_retirement_value_check working_situation_lead_tenant_over_retirement_value_check
person_2_known person_2_known
person_2_relationship_to_lead person_2_relationship_to_lead
person_2_age_child person_2_age
person_2_age_non_child
no_females_pregnant_household_person_2_age_value_check no_females_pregnant_household_person_2_age_value_check
females_in_soft_age_range_in_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check
age_2_under_retirement_value_check age_2_under_retirement_value_check
@ -64,8 +63,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_2_over_retirement_value_check working_situation_2_over_retirement_value_check
person_3_known person_3_known
person_3_relationship_to_lead person_3_relationship_to_lead
person_3_age_child person_3_age
person_3_age_non_child
no_females_pregnant_household_person_3_age_value_check no_females_pregnant_household_person_3_age_value_check
females_in_soft_age_range_in_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check
age_3_under_retirement_value_check age_3_under_retirement_value_check
@ -79,8 +77,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_3_over_retirement_value_check working_situation_3_over_retirement_value_check
person_4_known person_4_known
person_4_relationship_to_lead person_4_relationship_to_lead
person_4_age_child person_4_age
person_4_age_non_child
no_females_pregnant_household_person_4_age_value_check no_females_pregnant_household_person_4_age_value_check
females_in_soft_age_range_in_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check
age_4_under_retirement_value_check age_4_under_retirement_value_check
@ -94,8 +91,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_4_over_retirement_value_check working_situation_4_over_retirement_value_check
person_5_known person_5_known
person_5_relationship_to_lead person_5_relationship_to_lead
person_5_age_child person_5_age
person_5_age_non_child
no_females_pregnant_household_person_5_age_value_check no_females_pregnant_household_person_5_age_value_check
females_in_soft_age_range_in_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check
age_5_under_retirement_value_check age_5_under_retirement_value_check
@ -109,8 +105,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_5_over_retirement_value_check working_situation_5_over_retirement_value_check
person_6_known person_6_known
person_6_relationship_to_lead person_6_relationship_to_lead
person_6_age_child person_6_age
person_6_age_non_child
no_females_pregnant_household_person_6_age_value_check no_females_pregnant_household_person_6_age_value_check
females_in_soft_age_range_in_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check
age_6_under_retirement_value_check age_6_under_retirement_value_check
@ -124,8 +119,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_6_over_retirement_value_check working_situation_6_over_retirement_value_check
person_7_known person_7_known
person_7_relationship_to_lead person_7_relationship_to_lead
person_7_age_child person_7_age
person_7_age_non_child
no_females_pregnant_household_person_7_age_value_check no_females_pregnant_household_person_7_age_value_check
females_in_soft_age_range_in_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check
age_7_under_retirement_value_check age_7_under_retirement_value_check
@ -139,8 +133,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_7_over_retirement_value_check working_situation_7_over_retirement_value_check
person_8_known person_8_known
person_8_relationship_to_lead person_8_relationship_to_lead
person_8_age_child person_8_age
person_8_age_non_child
no_females_pregnant_household_person_8_age_value_check no_females_pregnant_household_person_8_age_value_check
females_in_soft_age_range_in_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check
age_8_under_retirement_value_check age_8_under_retirement_value_check
@ -191,8 +184,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_2_relationship_to_lead person_2_relationship_to_lead
relationship_2_partner_under_16_value_check relationship_2_partner_under_16_value_check
relationship_2_multiple_partners_value_check relationship_2_multiple_partners_value_check
person_2_age_child person_2_age
person_2_age_non_child
no_females_pregnant_household_person_2_age_value_check no_females_pregnant_household_person_2_age_value_check
females_in_soft_age_range_in_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check
age_2_under_retirement_value_check age_2_under_retirement_value_check
@ -209,8 +201,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_3_relationship_to_lead person_3_relationship_to_lead
relationship_3_partner_under_16_value_check relationship_3_partner_under_16_value_check
relationship_3_multiple_partners_value_check relationship_3_multiple_partners_value_check
person_3_age_child person_3_age
person_3_age_non_child
no_females_pregnant_household_person_3_age_value_check no_females_pregnant_household_person_3_age_value_check
females_in_soft_age_range_in_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check
age_3_under_retirement_value_check age_3_under_retirement_value_check
@ -227,8 +218,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_4_relationship_to_lead person_4_relationship_to_lead
relationship_4_partner_under_16_value_check relationship_4_partner_under_16_value_check
relationship_4_multiple_partners_value_check relationship_4_multiple_partners_value_check
person_4_age_child person_4_age
person_4_age_non_child
no_females_pregnant_household_person_4_age_value_check no_females_pregnant_household_person_4_age_value_check
females_in_soft_age_range_in_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check
age_4_under_retirement_value_check age_4_under_retirement_value_check
@ -245,8 +235,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_5_relationship_to_lead person_5_relationship_to_lead
relationship_5_partner_under_16_value_check relationship_5_partner_under_16_value_check
relationship_5_multiple_partners_value_check relationship_5_multiple_partners_value_check
person_5_age_child person_5_age
person_5_age_non_child
no_females_pregnant_household_person_5_age_value_check no_females_pregnant_household_person_5_age_value_check
females_in_soft_age_range_in_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check
age_5_under_retirement_value_check age_5_under_retirement_value_check
@ -263,8 +252,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_6_relationship_to_lead person_6_relationship_to_lead
relationship_6_partner_under_16_value_check relationship_6_partner_under_16_value_check
relationship_6_multiple_partners_value_check relationship_6_multiple_partners_value_check
person_6_age_child person_6_age
person_6_age_non_child
no_females_pregnant_household_person_6_age_value_check no_females_pregnant_household_person_6_age_value_check
females_in_soft_age_range_in_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check
age_6_under_retirement_value_check age_6_under_retirement_value_check
@ -281,8 +269,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_7_relationship_to_lead person_7_relationship_to_lead
relationship_7_partner_under_16_value_check relationship_7_partner_under_16_value_check
relationship_7_multiple_partners_value_check relationship_7_multiple_partners_value_check
person_7_age_child person_7_age
person_7_age_non_child
no_females_pregnant_household_person_7_age_value_check no_females_pregnant_household_person_7_age_value_check
females_in_soft_age_range_in_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check
age_7_under_retirement_value_check age_7_under_retirement_value_check
@ -299,8 +286,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_8_relationship_to_lead person_8_relationship_to_lead
relationship_8_partner_under_16_value_check relationship_8_partner_under_16_value_check
relationship_8_multiple_partners_value_check relationship_8_multiple_partners_value_check
person_8_age_child person_8_age
person_8_age_non_child
no_females_pregnant_household_person_8_age_value_check no_females_pregnant_household_person_8_age_value_check
females_in_soft_age_range_in_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check
age_8_under_retirement_value_check age_8_under_retirement_value_check

3
spec/models/form/lettings/subsections/income_and_benefits_spec.rb

@ -30,8 +30,7 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do
rent_bi_weekly rent_bi_weekly
rent_4_weekly rent_4_weekly
rent_monthly rent_monthly
brent_min_rent_value_check brent_rent_value_check
brent_max_rent_value_check
scharge_value_check scharge_value_check
pscharge_value_check pscharge_value_check
supcharg_value_check supcharg_value_check

12
spec/models/form/lettings/subsections/property_information_spec.rb

@ -27,8 +27,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
uprn_confirmation uprn_confirmation
address address
property_local_authority property_local_authority
local_authority_min_rent_value_check local_authority_rent_value_check
local_authority_max_rent_value_check
first_time_property_let_as_social_housing first_time_property_let_as_social_housing
property_let_type property_let_type
property_vacancy_reason_not_first_let property_vacancy_reason_not_first_let
@ -38,8 +37,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_building_type property_building_type
property_wheelchair_accessible property_wheelchair_accessible
property_number_of_bedrooms property_number_of_bedrooms
beds_min_rent_value_check beds_rent_value_check
beds_max_rent_value_check
void_date void_date
void_date_value_check void_date_value_check
property_major_repairs property_major_repairs
@ -66,8 +64,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
uprn_selection uprn_selection
address address
property_local_authority property_local_authority
local_authority_min_rent_value_check local_authority_rent_value_check
local_authority_max_rent_value_check
first_time_property_let_as_social_housing first_time_property_let_as_social_housing
property_let_type property_let_type
property_vacancy_reason_not_first_let property_vacancy_reason_not_first_let
@ -76,8 +73,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_building_type property_building_type
property_wheelchair_accessible property_wheelchair_accessible
property_number_of_bedrooms property_number_of_bedrooms
beds_min_rent_value_check beds_rent_value_check
beds_max_rent_value_check
void_date void_date
void_date_value_check void_date_value_check
property_major_repairs property_major_repairs

4
spec/services/documentation_generator_spec.rb

@ -89,7 +89,7 @@ describe DocumentationGenerator do
end end
describe ":describe_soft_validations" do describe ":describe_soft_validations" do
let(:all_validation_methods) { ["rent_in_soft_min_range?"] } let(:all_validation_methods) { ["rent_soft_validation_triggered?"] }
let(:response) do let(:response) do
{ "choices" => [{ "message" => { "tool_calls" => [{ "function" => { "arguments" => { "choices" => [{ "message" => { "tool_calls" => [{ "function" => { "arguments" =>
"{\n \"description\": \"Validates the format.\",\n \"validation_type\": \"format\",\n \"other_validated_models\": \"User\"}" } }] } }] } "{\n \"description\": \"Validates the format.\",\n \"validation_type\": \"format\",\n \"other_validated_models\": \"User\"}" } }] } }] }
@ -100,7 +100,7 @@ describe DocumentationGenerator do
it "creates new validation documentation records" do it "creates new validation documentation records" do
expect { described_class.new.describe_soft_validations(client, all_validation_methods, all_helper_methods, log_type) }.to change(LogValidation, :count) expect { described_class.new.describe_soft_validations(client, all_validation_methods, all_helper_methods, log_type) }.to change(LogValidation, :count)
expect(LogValidation.where(validation_name: "rent_in_soft_min_range?").count).to be_positive expect(LogValidation.where(validation_name: "rent_soft_validation_triggered?").count).to be_positive
any_validation = LogValidation.first any_validation = LogValidation.first
expect(any_validation.description).to eq("Validates the format.") expect(any_validation.description).to eq("Validates the format.")
expect(any_validation.field).not_to be_empty expect(any_validation.field).not_to be_empty

6
spec/services/merge/merge_organisations_service_spec.rb

@ -1317,9 +1317,9 @@ RSpec.describe Merge::MergeOrganisationsService do
merging_organisation.reload merging_organisation.reload
expect(new_absorbing_organisation.owned_lettings_logs.count).to eq(2) expect(new_absorbing_organisation.owned_lettings_logs.count).to eq(2)
expect(new_absorbing_organisation.managed_lettings_logs.count).to eq(1) expect(new_absorbing_organisation.managed_lettings_logs.count).to eq(1)
expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name))
expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.first.locations.first) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name).locations.first)
expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name))
expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).location).to eq(nil) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).location).to eq(nil)
end end

Loading…
Cancel
Save