Browse Source

Merge branch 'main' into CLDC-3683-extract-household-situation-copy

pull/2730/head
kosiakkatrina 9 months ago committed by GitHub
parent
commit
203b761f3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      Gemfile.lock
  2. 1
      app/models/form/lettings/pages/declaration.rb
  3. 2
      app/models/form/lettings/pages/location.rb
  4. 2
      app/models/form/lettings/pages/location_search.rb
  5. 2
      app/models/form/lettings/pages/rent_type.rb
  6. 1
      app/models/form/lettings/pages/scheme.rb
  7. 2
      app/models/form/lettings/pages/type_of_access_needs.rb
  8. 3
      app/models/form/lettings/questions/armedforces.rb
  9. 3
      app/models/form/lettings/questions/condition_effects.rb
  10. 2
      app/models/form/lettings/questions/created_by_id.rb
  11. 3
      app/models/form/lettings/questions/housingneeds.rb
  12. 4
      app/models/form/lettings/questions/housingneeds_other.rb
  13. 4
      app/models/form/lettings/questions/housingneeds_type.rb
  14. 3
      app/models/form/lettings/questions/illness.rb
  15. 3
      app/models/form/lettings/questions/irproduct_other.rb
  16. 3
      app/models/form/lettings/questions/leftreg.rb
  17. 11
      app/models/form/lettings/questions/location_id.rb
  18. 12
      app/models/form/lettings/questions/location_id_search.rb
  19. 2
      app/models/form/lettings/questions/managing_organisation.rb
  20. 3
      app/models/form/lettings/questions/needs_type.rb
  21. 3
      app/models/form/lettings/questions/preg_occ.rb
  22. 3
      app/models/form/lettings/questions/property_reference.rb
  23. 19
      app/models/form/lettings/questions/renewal.rb
  24. 3
      app/models/form/lettings/questions/rent_type.rb
  25. 3
      app/models/form/lettings/questions/reservist.rb
  26. 11
      app/models/form/lettings/questions/scheme_id.rb
  27. 2
      app/models/form/lettings/questions/stock_owner.rb
  28. 2
      app/models/form/lettings/questions/tenancy_start_date.rb
  29. 3
      app/models/form/lettings/questions/tenant_code.rb
  30. 1
      app/models/form/lettings/subsections/household_needs.rb
  31. 1
      app/models/form/sales/pages/age1.rb
  32. 1
      app/models/form/sales/pages/age2.rb
  33. 1
      app/models/form/sales/pages/buyer1_ethnic_background_arab.rb
  34. 1
      app/models/form/sales/pages/buyer1_ethnic_background_asian.rb
  35. 1
      app/models/form/sales/pages/buyer1_ethnic_background_black.rb
  36. 1
      app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb
  37. 1
      app/models/form/sales/pages/buyer1_ethnic_background_white.rb
  38. 1
      app/models/form/sales/pages/buyer2_ethnic_background_arab.rb
  39. 1
      app/models/form/sales/pages/buyer2_ethnic_background_asian.rb
  40. 1
      app/models/form/sales/pages/buyer2_ethnic_background_black.rb
  41. 1
      app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb
  42. 1
      app/models/form/sales/pages/buyer2_ethnic_background_white.rb
  43. 1
      app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb
  44. 1
      app/models/form/sales/pages/buyer2_working_situation.rb
  45. 2
      app/models/form/sales/pages/buyer_interview.rb
  46. 5
      app/models/form/sales/pages/buyer_live_in_value_check.rb
  47. 1
      app/models/form/sales/pages/gender_identity2.rb
  48. 8
      app/models/form/sales/pages/multiple_partners_value_check.rb
  49. 6
      app/models/form/sales/pages/not_retired_value_check.rb
  50. 5
      app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb
  51. 8
      app/models/form/sales/pages/partner_under_16_value_check.rb
  52. 1
      app/models/form/sales/pages/person_age.rb
  53. 1
      app/models/form/sales/pages/person_gender_identity.rb
  54. 1
      app/models/form/sales/pages/person_relationship_to_buyer_1.rb
  55. 5
      app/models/form/sales/pages/person_student_not_child_value_check.rb
  56. 1
      app/models/form/sales/pages/person_working_situation.rb
  57. 2
      app/models/form/sales/pages/privacy_notice.rb
  58. 8
      app/models/form/sales/pages/retirement_value_check.rb
  59. 3
      app/models/form/sales/questions/age1.rb
  60. 3
      app/models/form/sales/questions/age2.rb
  61. 4
      app/models/form/sales/questions/buyer1_age_known.rb
  62. 4
      app/models/form/sales/questions/buyer1_ethnic_background_arab.rb
  63. 4
      app/models/form/sales/questions/buyer1_ethnic_background_asian.rb
  64. 4
      app/models/form/sales/questions/buyer1_ethnic_background_black.rb
  65. 4
      app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb
  66. 4
      app/models/form/sales/questions/buyer1_ethnic_background_white.rb
  67. 3
      app/models/form/sales/questions/buyer1_ethnic_group.rb
  68. 3
      app/models/form/sales/questions/buyer1_live_in_property.rb
  69. 3
      app/models/form/sales/questions/buyer1_nationality.rb
  70. 3
      app/models/form/sales/questions/buyer1_working_situation.rb
  71. 3
      app/models/form/sales/questions/buyer2_age_known.rb
  72. 3
      app/models/form/sales/questions/buyer2_ethnic_background_arab.rb
  73. 3
      app/models/form/sales/questions/buyer2_ethnic_background_asian.rb
  74. 3
      app/models/form/sales/questions/buyer2_ethnic_background_black.rb
  75. 3
      app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb
  76. 3
      app/models/form/sales/questions/buyer2_ethnic_background_white.rb
  77. 2
      app/models/form/sales/questions/buyer2_ethnic_group.rb
  78. 2
      app/models/form/sales/questions/buyer2_live_in_property.rb
  79. 2
      app/models/form/sales/questions/buyer2_nationality.rb
  80. 3
      app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
  81. 3
      app/models/form/sales/questions/buyer2_working_situation.rb
  82. 2
      app/models/form/sales/questions/buyer_interview.rb
  83. 3
      app/models/form/sales/questions/buyer_live_in_value_check.rb
  84. 10
      app/models/form/sales/questions/gender_identity1.rb
  85. 9
      app/models/form/sales/questions/gender_identity2.rb
  86. 3
      app/models/form/sales/questions/multiple_partners_value_check.rb
  87. 2
      app/models/form/sales/questions/nationality_all.rb
  88. 3
      app/models/form/sales/questions/nationality_all_group.rb
  89. 3
      app/models/form/sales/questions/not_retired_value_check.rb
  90. 14
      app/models/form/sales/questions/number_of_others_in_property.rb
  91. 3
      app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb
  92. 3
      app/models/form/sales/questions/partner_under_16_value_check.rb
  93. 9
      app/models/form/sales/questions/person_age.rb
  94. 3
      app/models/form/sales/questions/person_age_known.rb
  95. 9
      app/models/form/sales/questions/person_gender_identity.rb
  96. 2
      app/models/form/sales/questions/person_known.rb
  97. 3
      app/models/form/sales/questions/person_relationship_to_buyer_1.rb
  98. 3
      app/models/form/sales/questions/person_student_not_child_value_check.rb
  99. 3
      app/models/form/sales/questions/person_working_situation.rb
  100. 2
      app/models/form/sales/questions/privacy_notice.rb
  101. Some files were not shown because too many files have changed in this diff Show More

4
Gemfile.lock

@ -377,8 +377,7 @@ GEM
responders (3.1.1) responders (3.1.1)
actionpack (>= 5.2) actionpack (>= 5.2)
railties (>= 5.2) railties (>= 5.2)
rexml (3.3.6) rexml (3.3.9)
strscan
roo (2.10.1) roo (2.10.1)
nokogiri (~> 1) nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0) rubyzip (>= 1.3.0, < 3.0.0)
@ -463,7 +462,6 @@ GEM
smart_properties (1.17.0) smart_properties (1.17.0)
stimulus-rails (1.3.3) stimulus-rails (1.3.3)
railties (>= 6.0.0) railties (>= 6.0.0)
strscan (3.1.0)
thor (1.3.2) thor (1.3.2)
thread_safe (0.3.6) thread_safe (0.3.6)
timecop (0.9.8) timecop (0.9.8)

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

@ -2,7 +2,6 @@ class Form::Lettings::Pages::Declaration < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "declaration" @id = "declaration"
@header = "Ministry of Housing, Communities and Local Government privacy notice"
end end
def questions def questions

2
app/models/form/lettings/pages/location.rb

@ -8,7 +8,7 @@ class Form::Lettings::Pages::Location < ::Form::Page
"scheme_has_large_number_of_locations?" => false, "scheme_has_large_number_of_locations?" => false,
}, },
] ]
@header = "Location" @copy_key = "lettings.setup.location_id.less_than_twenty"
@next_unresolved_page_id = :check_answers @next_unresolved_page_id = :check_answers
end end

2
app/models/form/lettings/pages/location_search.rb

@ -8,7 +8,7 @@ class Form::Lettings::Pages::LocationSearch < ::Form::Page
"scheme_has_large_number_of_locations?" => true, "scheme_has_large_number_of_locations?" => true,
}, },
] ]
@header = "Location" @copy_key = "lettings.setup.location_id.twenty_or_more"
@next_unresolved_page_id = :check_answers @next_unresolved_page_id = :check_answers
end end

2
app/models/form/lettings/pages/rent_type.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentType < ::Form::Page
def initialize(_id, hsh, subsection) def initialize(_id, hsh, subsection)
super("rent_type", hsh, subsection) super("rent_type", hsh, subsection)
@derived = true @derived = true
@header = "Rent Type" @copy_key = "lettings.setup.rent_type"
end end
def questions def questions

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

@ -6,7 +6,6 @@ class Form::Lettings::Pages::Scheme < ::Form::Page
"needstype" => 2, "needstype" => 2,
}, },
] ]
@header = "Scheme"
@next_unresolved_page_id = "location" @next_unresolved_page_id = "location"
end end

2
app/models/form/lettings/pages/type_of_access_needs.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "type_of_access_needs" @id = "type_of_access_needs"
@header = "Disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type"
@depends_on = [{ "housingneeds" => 1 }] @depends_on = [{ "housingneeds" => 1 }]
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "armedforces" @id = "armedforces"
@check_answer_label = "Household links to UK armed forces"
@header = "Does anybody in the household have any links to the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This excludes national service.<br><br>If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner."
@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/condition_effects.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "condition_effects" @id = "condition_effects"
@check_answer_label = "How is person affected by condition or illness"
@header = "How is the person affected by their condition or illness?"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -4,8 +4,6 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "assigned_to_id" @id = "assigned_to_id"
@check_answer_label = "Log owner"
@header = "Which user are you creating this log for?"
@derived = true @derived = true
@type = "select" @type = "select"
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds" @id = "housingneeds"
@check_answer_label = "Anybody with disabled access needs"
@header = "Does anybody in the household have any disabled access needs?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds_other" @id = "housingneeds_other"
@check_answer_label = "Other disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other"
@header = "Do they have any other disabled access needs?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds_type" @id = "housingneeds_type"
@check_answer_label = "Disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_type"
@header = "What type of access needs do they have?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Illness < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "illness" @id = "illness"
@check_answer_label = "Anybody in household with physical or mental health condition"
@header = "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "irproduct_other" @id = "irproduct_other"
@check_answer_label = "Product name" @copy_key = "lettings.setup.rent_type.irproduct_other"
@header = "Name of rent product"
@type = "text" @type = "text"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "leftreg" @id = "leftreg"
@check_answer_label = "Person still serving in UK armed forces"
@header = "Is the person still serving in the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "location_id" @id = "location_id"
@check_answer_label = "Location" @copy_key = "lettings.setup.location_id.less_than_twenty"
@header = header_text
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@inferred_answers = { @inferred_answers = {
@ -56,13 +55,5 @@ private
false false
end end
def header_text
if form.start_date && form.start_date.year >= 2023
"Which location is this letting for?"
else
"Which location is this log for?"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze
end end

12
app/models/form/lettings/questions/location_id_search.rb

@ -2,10 +2,8 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "location_id" @id = "location_id"
@check_answer_label = "Location"
@header = header_text
@hint_text = '<div class="govuk-inset-text">This scheme has 20 or more locations.</div>Enter postcode or address.'
@type = "select" @type = "select"
@copy_key = "lettings.setup.location_id.twenty_or_more"
@answer_options = answer_options @answer_options = answer_options
@inferred_answers = { @inferred_answers = {
"location.name": { "location.name": {
@ -52,13 +50,5 @@ private
false false
end end
def header_text
if form.start_date && form.start_date.year >= 2023
"Which location is this letting for?"
else
"Which location is this log for?"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze
end end

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "managing_organisation_id" @id = "managing_organisation_id"
@check_answer_label = "Managing agent"
@header = "Which organisation manages this letting?"
@derived = true @derived = true
@type = "select" @type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

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

@ -2,9 +2,6 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "needstype" @id = "needstype"
@check_answer_label = "Needs type"
@header = "What is the needs type?"
@hint_text = "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes."
@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] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "preg_occ" @id = "preg_occ"
@check_answer_label = "Anybody in household pregnant"
@header = "Is anybody in the household pregnant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -2,9 +2,6 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "propcode" @id = "propcode"
@check_answer_label = "Property reference"
@header = "What is the property reference?"
@hint_text = "This is how you usually refer to this property on your own systems."
@type = "text" @type = "text"
@width = 10 @width = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

19
app/models/form/lettings/questions/renewal.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Renewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "renewal" @id = "renewal"
@check_answer_label = "Property renewal"
@header = header_text
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = hint_text
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
end end
@ -16,21 +13,5 @@ class Form::Lettings::Questions::Renewal < ::Form::Question
} }
.freeze .freeze
def header_text
if form.start_year_after_2024?
"Is this letting a renewal of social housing to the same tenant in the same property?"
else
"Is this letting a renewal?"
end
end
def hint_text
if form.start_year_after_2024?
"If the property was previously being used as temporary accommodation, then answer 'no'"
else
"A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze
end end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rent_type" @id = "rent_type"
@check_answer_label = "Rent type" @copy_key = "lettings.setup.rent_type.rent_type"
@header = "What is the rent type?"
@type = "radio" @type = "radio"
@top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions" @top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reservist < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reservist" @id = "reservist"
@check_answer_label = "Person seriously injured or ill as result of serving in UK armed forces"
@header = "Was the person seriously injured or ill as a result of serving in the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -1,8 +1,6 @@
class Form::Lettings::Questions::SchemeId < ::Form::Question class Form::Lettings::Questions::SchemeId < ::Form::Question
def initialize(_id, hsh, page) def initialize(_id, hsh, page)
super("scheme_id", hsh, page) super("scheme_id", hsh, page)
@check_answer_label = "Scheme name"
@header = "What scheme is this log for?"
@type = "select" @type = "select"
@answer_options = answer_options @answer_options = answer_options
@top_guidance_partial = "finding_scheme" @top_guidance_partial = "finding_scheme"
@ -48,15 +46,6 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question
lettings_log.form.get_question("postcode_full", nil).label_from_value(lettings_log.postcode_full) unless lettings_log.scheme_has_multiple_locations? lettings_log.form.get_question("postcode_full", nil).label_from_value(lettings_log.postcode_full) unless lettings_log.scheme_has_multiple_locations?
end end
def hint_text
if form.start_year_after_2024?
"Enter postcode or scheme name.<br><br>
A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people."
else
"Enter postcode or scheme name"
end
end
private private
def supported_housing_selected?(lettings_log) def supported_housing_selected?(lettings_log)

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "owning_organisation_id" @id = "owning_organisation_id"
@check_answer_label = "Stock owner"
@header = "Which organisation owns this property?"
@derived = true @derived = true
@type = "select" @type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "startdate" @id = "startdate"
@check_answer_label = "Tenancy start date"
@header = "What is the tenancy start date?"
@type = "date" @type = "date"
@unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

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

@ -2,9 +2,6 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancycode" @id = "tenancycode"
@check_answer_label = "Tenant code"
@header = "What is the tenant code?"
@hint_text = "This is how you usually refer to this tenancy on your own systems."
@type = "text" @type = "text"
@width = 10 @width = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?

1
app/models/form/lettings/subsections/household_needs.rb

@ -2,6 +2,7 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection
def initialize(id, hsh, section) def initialize(id, hsh, section)
super super
@id = "household_needs" @id = "household_needs"
@copy_key = "lettings.household_needs.housingneeds_type"
@label = "Household needs" @label = "Household needs"
@depends_on = [{ "non_location_setup_questions_completed?" => true }] @depends_on = [{ "non_location_setup_questions_completed?" => true }]
end end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Age1 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_age" @id = "buyer_1_age"
@copy_key = "sales.household_characteristics.age1"
@depends_on = [ @depends_on = [
{ {
"buyer_has_seen_privacy_notice?" => true, "buyer_has_seen_privacy_notice?" => true,

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Age2 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_age" @id = "buyer_2_age"
@copy_key = "sales.household_characteristics.age2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "joint_purchase?" => true,

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

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

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_asian" @id = "buyer_1_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 2, "ethnic_group" => 2,
}] }]

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

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

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

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

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

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

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundArab < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_arab" @id = "buyer_2_ethnic_background_arab"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 4, "ethnic_group2" => 4,
}] }]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_asian" @id = "buyer_2_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 2, "ethnic_group2" => 2,
}] }]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundBlack < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_black" @id = "buyer_2_ethnic_background_black"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 3, "ethnic_group2" => 3,
}] }]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundMixed < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_mixed" @id = "buyer_2_ethnic_background_mixed"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 1, "ethnic_group2" => 1,
}] }]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundWhite < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_white" @id = "buyer_2_ethnic_background_white"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 0, "ethnic_group2" => 0,
}] }]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2RelationshipToBuyer1 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_relationship_to_buyer_1" @id = "buyer_2_relationship_to_buyer_1"
@copy_key = "sales.household_characteristics.relat2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "joint_purchase?" => true,

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2WorkingSituation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_working_situation" @id = "buyer_2_working_situation"
@copy_key = "sales.household_characteristics.ecstat2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "joint_purchase?" => true,

2
app/models/form/sales/pages/buyer_interview.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@joint_purchase = joint_purchase @joint_purchase = joint_purchase
@copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @copy_key = "sales.#{subsection.id}.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end end
def questions def questions

5
app/models/form/sales/pages/buyer_live_in_value_check.rb

@ -6,12 +6,13 @@ class Form::Sales::Pages::BuyerLiveInValueCheck < Form::Sales::Pages::Person
"buyer#{person_index}_livein_wrong_for_ownership_type?" => true, "buyer#{person_index}_livein_wrong_for_ownership_type?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}"
@title_text = { @title_text = {
"translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
} }
end end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::GenderIdentity2 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_gender_identity" @id = "buyer_2_gender_identity"
@copy_key = "sales.household_characteristics.sex2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "joint_purchase?" => true,

8
app/models/form/sales/pages/multiple_partners_value_check.rb

@ -6,12 +6,16 @@ class Form::Sales::Pages::MultiplePartnersValueCheck < Form::Sales::Pages::Perso
"multiple_partners?" => true, "multiple_partners?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.multiple_partners_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.multiple_partners_sales.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@informative_text = {}
end end
def questions def questions

6
app/models/form/sales/pages/not_retired_value_check.rb

@ -7,11 +7,13 @@ class Form::Sales::Pages::NotRetiredValueCheck < Form::Sales::Pages::Person
}, },
] ]
@person_index = person_index @person_index = person_index
@copy_key = "sales.soft_validations.retirement_value_check.max"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.retirement.max.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
} }
end end

5
app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb

@ -1,12 +1,13 @@
class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.old_persons_shared_ownership.title_text.#{joint_purchase ? 'two' : 'one'}", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}",
"arguments" => [], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.old_persons_shared_ownership.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@joint_purchase = joint_purchase @joint_purchase = joint_purchase

8
app/models/form/sales/pages/partner_under_16_value_check.rb

@ -6,9 +6,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person
"person_#{person_index}_partner_under_16?" => true, "person_#{person_index}_partner_under_16?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.partner_under_16_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -17,7 +18,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonAge < Form::Sales::Pages::Person class Form::Sales::Pages::PersonAge < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super super
@copy_key = person_index == 2 ? "sales.household_characteristics.age2.person" : "sales.household_characteristics.age#{person_index}"
@depends_on = [{ "details_known_#{person_index}" => 1 }] @depends_on = [{ "details_known_#{person_index}" => 1 }]
end end

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonGenderIdentity < Form::Sales::Pages::Person class Form::Sales::Pages::PersonGenderIdentity < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super super
@copy_key = "sales.household_characteristics.sex2.person" if person_index == 2
@depends_on = [ @depends_on = [
{ "details_known_#{person_index}" => 1 }, { "details_known_#{person_index}" => 1 },
] ]

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonRelationshipToBuyer1 < ::Form::Sales::Pages::Person class Form::Sales::Pages::PersonRelationshipToBuyer1 < ::Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super super
@copy_key = "sales.household_characteristics.relat2.person" if person_index == 2
@depends_on = [ @depends_on = [
{ "details_known_#{person_index}" => 1 }, { "details_known_#{person_index}" => 1 },
] ]

5
app/models/form/sales/pages/person_student_not_child_value_check.rb

@ -6,11 +6,12 @@ class Form::Sales::Pages::PersonStudentNotChildValueCheck < Form::Sales::Pages::
"person_#{person_index}_student_not_child?" => true, "person_#{person_index}_student_not_child?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.student_not_child_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.student_not_child.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = {} @informative_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [] }
end end
def questions def questions

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonWorkingSituation < Form::Sales::Pages::Person class Form::Sales::Pages::PersonWorkingSituation < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super super
@copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2
@depends_on = [ @depends_on = [
{ {
"details_known_#{person_index}" => 1, "details_known_#{person_index}" => 1,

2
app/models/form/sales/pages/privacy_notice.rb

@ -1,7 +1,7 @@
class Form::Sales::Pages::PrivacyNotice < ::Form::Page class Form::Sales::Pages::PrivacyNotice < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @copy_key = "sales.#{subsection.id}.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@joint_purchase = joint_purchase @joint_purchase = joint_purchase
end end

8
app/models/form/sales/pages/retirement_value_check.rb

@ -7,8 +7,9 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person
}, },
] ]
@person_index = person_index @person_index = person_index
@copy_key = "sales.soft_validations.retirement_value_check.min"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -17,7 +18,10 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

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

@ -2,10 +2,9 @@ class Form::Sales::Questions::Age1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1" @id = "age1"
@check_answer_label = "Buyer 1’s age"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@copy_key = "sales.household_characteristics.age1.age1"
@inferred_check_answers_value = [ @inferred_check_answers_value = [
{ {
"condition" => { "age1_known" => 1 }, "condition" => { "age1_known" => 1 },

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Age2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age2" @id = "age2"
@check_answer_label = "Buyer 2’s age" @copy_key = "sales.household_characteristics.age2.buyer.age2"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1_known" @id = "age1_known"
@check_answer_label = "Buyer 1’s age"
@header = "Do you know buyer 1’s age?"
@type = "radio" @type = "radio"
@copy_key = "sales.household_characteristics.age1.age1_known"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@conditional_for = { @conditional_for = {
"age1" => [0], "age1" => [0],
} }

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_arab"
@header = "Which of the following best describes buyer 1’s Arab background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@header = "Which of the following best describes buyer 1’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_black"
@header = "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed"
@header = "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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

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

@ -2,10 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_white"
@header = "Which of the following best describes buyer 1’s White background?"
@type = "radio" @type = "radio"
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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/sales/questions/buyer1_ethnic_group.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic_group" @id = "ethnic_group"
@check_answer_label = "Buyer 1’s ethnic group"
@header = "What is buyer 1’s ethnic group?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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/sales/questions/buyer1_live_in_property.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buy1livein" @id = "buy1livein"
@check_answer_label = "Will buyer 1 live in the property?"
@header = "Will buyer 1 live in the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 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/sales/questions/buyer1_nationality.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "national" @id = "national"
@check_answer_label = "Buyer 1’s nationality"
@header = "What is buyer 1’s nationality?"
@type = "radio" @type = "radio"
@hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

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

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ecstat1" @id = "ecstat1"
@check_answer_label = "Buyer 1's working situation"
@header = "Which of these best describes buyer 1's working situation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@check_answers_card_number = 1 @check_answers_card_number = 1
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age2_known" @id = "age2_known"
@check_answer_label = "Buyer 2’s age" @copy_key = "sales.household_characteristics.age2.buyer.age2_known"
@header = "Do you know buyer 2’s age?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @conditional_for = {

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@header = "Which of the following best describes buyer 2’s Arab background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@header = "Which of the following best describes buyer 2’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@header = "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_mixed"
@header = "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@header = "Which of the following best describes buyer 2’s White background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic_group2" @id = "ethnic_group2"
@check_answer_label = "Buyer 2’s ethnic group"
@header = "What is buyer 2’s ethnic group?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buy2livein" @id = "buy2livein"
@check_answer_label = "Will buyer 2 live in the property?"
@header = "Will buyer 2 live in the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "nationalbuy2" @id = "nationalbuy2"
@check_answer_label = "Buyer 2’s nationality"
@header = "What is buyer 2’s nationality?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "relat2" @id = "relat2"
@check_answer_label = "Buyer 2's relationship to buyer 1" @copy_key = "sales.household_characteristics.relat2.buyer"
@header = "What is buyer 2's relationship to buyer 1?"
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ecstat2" @id = "ecstat2"
@check_answer_label = "Buyer 2's working situation" @copy_key = "sales.household_characteristics.ecstat2.buyer"
@header = "Which of these best describes buyer 2's working situation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
def initialize(id, hsh, page, joint_purchase:) def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page) super(id, hsh, page)
@id = "noint" @id = "noint"
@copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @copy_key = "sales.#{subsection.id}.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@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/buyer_live_in_value_check.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::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 = "buyer_livein_value_check" @id = "buyer_livein_value_check"
@check_answer_label = "Buyer live in confirmation" @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

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

@ -2,8 +2,6 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex1" @id = "sex1"
@check_answer_label = "Buyer 1’s gender identity"
@header = "Which of these best describes buyer 1’s gender identity?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@ -17,13 +15,5 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
"R" => { "value" => "Prefers not to say" }, "R" => { "value" => "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
"Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 23 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 23 }.freeze
end end

9
app/models/form/sales/questions/gender_identity2.rb

@ -2,9 +2,8 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex2" @id = "sex2"
@check_answer_label = "Buyer 2’s gender identity"
@header = "Which of these best describes buyer 2’s gender identity?"
@type = "radio" @type = "radio"
@copy_key = "sales.household_characteristics.sex2.buyer"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -23,11 +22,5 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
"R" => { "value" => "Buyer prefers not to say" }, "R" => { "value" => "Buyer prefers not to say" },
}.freeze }.freeze
def hint_text
return unless 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."
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 31 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 31 }.freeze
end end

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::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 = "multiple_partners_value_check" @id = "multiple_partners_value_check"
@check_answer_label = "Multiple partners confirmation" @copy_key = "sales.soft_validations.multiple_partners_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

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

@ -1,8 +1,6 @@
class Form::Sales::Questions::NationalityAll < ::Form::Question class Form::Sales::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page, buyer_index) def initialize(id, hsh, page, buyer_index)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "Enter a nationality"
@type = "select" @type = "select"
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@check_answers_card_number = buyer_index @check_answers_card_number = buyer_index

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

@ -1,10 +1,7 @@
class Form::Sales::Questions::NationalityAllGroup < ::Form::Question class Form::Sales::Questions::NationalityAllGroup < ::Form::Question
def initialize(id, hsh, page, buyer_index) def initialize(id, hsh, page, buyer_index)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "What is buyer #{buyer_index}’s nationality?"
@type = "radio" @type = "radio"
@hint_text = "If buyer #{buyer_index} 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 buyer should decide which country to enter."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = buyer_index @check_answers_card_number = buyer_index
@conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] } @conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] }

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::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 = "retirement_value_check" @id = "retirement_value_check"
@check_answer_label = "Retirement confirmation" @copy_key = "sales.soft_validations.retirement_value_check.max"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this person isn't retired?"
end end
end end

14
app/models/form/sales/questions/number_of_others_in_property.rb

@ -2,10 +2,8 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
def initialize(id, hsh, page, joint_purchase:) def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page) super(id, hsh, page)
@id = "hholdcount" @id = "hholdcount"
@check_answer_label = "Number of other people living in the property" @copy_key = joint_purchase ? "sales.household_characteristics.hholdcount.joint_purchase" : "sales.household_characteristics.hholdcount.not_joint_purchase"
@header = "Besides the #{'buyer'.pluralize(joint_purchase ? 2 : 1)}, how many other people live or will live in the property?"
@type = "numeric" @type = "numeric"
@hint_text = hint(joint_purchase)
@width = 2 @width = 2
@min = 0 @min = 0
@max = 15 @max = 15
@ -13,15 +11,5 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::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
private
def hint(joint_purchase)
if joint_purchase
"You can provide details for a maximum of 4 other people for a joint purchase."
else
"You can provide details for a maximum of 5 other people if there is only one buyer."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37 }.freeze
end end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck < ::Form::Ques
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "old_persons_shared_ownership_value_check" @id = "old_persons_shared_ownership_value_check"
@check_answer_label = "Shared ownership confirmation" @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::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 = "partner_under_16_value_check" @id = "partner_under_16_value_check"
@check_answer_label = "Partner under 16 confirmation" @copy_key = "sales.soft_validations.partner_under_16_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

9
app/models/form/sales/questions/person_age.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonAge < ::Form::Question class Form::Sales::Questions::PersonAge < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s age"
@header = "Age"
@type = "numeric" @type = "numeric"
@copy_key = person_index == 2 ? "sales.household_characteristics.age2.person.age2" : "sales.household_characteristics.age#{person_index}.age#{person_index}"
@width = 3 @width = 3
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "age#{person_index}_known" => 1 }, "condition" => { "age#{person_index}_known" => 1 },
@ -27,10 +26,4 @@ class Form::Sales::Questions::PersonAge < ::Form::Question
base_question_number + (4 * @person_index) base_question_number + (4 * @person_index)
end end
def hint_text
if form.start_year_after_2024?
"Answer 1 for children aged under 1 year old"
end
end
end end

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

@ -1,10 +1,9 @@
class Form::Sales::Questions::PersonAgeKnown < ::Form::Question class Form::Sales::Questions::PersonAgeKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s age known?"
@header = "Do you know person #{person_index}’s age?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@copy_key = person_index == 2 ? "sales.household_characteristics.age2.person.age2_known" : "sales.household_characteristics.age#{person_index}.age#{person_index}_known"
@conditional_for = { @conditional_for = {
"age#{person_index}" => [0], "age#{person_index}" => [0],
} }

9
app/models/form/sales/questions/person_gender_identity.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question class Form::Sales::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)
@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"
@copy_key = "sales.household_characteristics.sex2.person" if person_index == 2
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -23,12 +22,6 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
"R" => { "value" => "Person prefers not to say" }, "R" => { "value" => "Person prefers not to say" },
}.freeze }.freeze
def hint_text
return unless 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."
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

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

@ -1,8 +1,6 @@
class Form::Sales::Questions::PersonKnown < ::Form::Question class Form::Sales::Questions::PersonKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Details known for person #{person_index}?"
@header = "Do you know the details for person #{person_index}?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index @check_answers_card_number = person_index

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

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s relationship to Buyer 1"
@header = "What is Person #{person_index}’s relationship to Buyer 1?"
@type = "radio" @type = "radio"
@copy_key = "sales.household_characteristics.relat2.person" if person_index == 2
@answer_options = answer_options @answer_options = answer_options
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::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 = "student_not_child_value_check" @id = "student_not_child_value_check"
@check_answer_label = "Student not a child confirmation" @copy_key = "sales.soft_validations.student_not_child_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this person is not a child?"
end end
end end

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

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question class Form::Sales::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)
@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"
@copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
def initialize(id, hsh, page, joint_purchase:) def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page) super(id, hsh, page)
@id = "privacynotice" @id = "privacynotice"
@copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @copy_key = "sales.#{subsection.id}.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "checkbox" @type = "checkbox"
@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]
@joint_purchase = joint_purchase @joint_purchase = joint_purchase

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save