Browse Source

CLDC-3181 Update question numbers for 2024 (#2252)

* Update question numbers for 2024

* Stub form in tests

* Stub form start_date for pages

* Add a default question number

* Fix a typo

* Update rebase test

* Refactor default question number

* Refactor person question numbers

* Display managing org for sales correctly in CYA

* Rebase fix

* More tweaks
pull/2295/head^2
kosiakkatrina 1 year ago committed by GitHub
parent
commit
6717eb6275
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/models/form/sales/pages/address.rb
  2. 4
      app/models/form/sales/questions/address_line1.rb
  3. 4
      app/models/form/sales/questions/age1.rb
  4. 4
      app/models/form/sales/questions/age2.rb
  5. 4
      app/models/form/sales/questions/armed_forces.rb
  6. 4
      app/models/form/sales/questions/armed_forces_spouse.rb
  7. 4
      app/models/form/sales/questions/buyer1_age_known.rb
  8. 4
      app/models/form/sales/questions/buyer1_ethnic_background_arab.rb
  9. 4
      app/models/form/sales/questions/buyer1_ethnic_background_asian.rb
  10. 4
      app/models/form/sales/questions/buyer1_ethnic_background_black.rb
  11. 4
      app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb
  12. 4
      app/models/form/sales/questions/buyer1_ethnic_background_white.rb
  13. 4
      app/models/form/sales/questions/buyer1_ethnic_group.rb
  14. 4
      app/models/form/sales/questions/buyer1_income.rb
  15. 4
      app/models/form/sales/questions/buyer1_income_known.rb
  16. 4
      app/models/form/sales/questions/buyer1_live_in_property.rb
  17. 4
      app/models/form/sales/questions/buyer1_mortgage.rb
  18. 4
      app/models/form/sales/questions/buyer1_nationality.rb
  19. 4
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  20. 4
      app/models/form/sales/questions/buyer1_working_situation.rb
  21. 4
      app/models/form/sales/questions/buyer2_age_known.rb
  22. 4
      app/models/form/sales/questions/buyer2_ethnic_background_arab.rb
  23. 4
      app/models/form/sales/questions/buyer2_ethnic_background_asian.rb
  24. 4
      app/models/form/sales/questions/buyer2_ethnic_background_black.rb
  25. 4
      app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb
  26. 4
      app/models/form/sales/questions/buyer2_ethnic_background_white.rb
  27. 4
      app/models/form/sales/questions/buyer2_ethnic_group.rb
  28. 4
      app/models/form/sales/questions/buyer2_income.rb
  29. 4
      app/models/form/sales/questions/buyer2_income_known.rb
  30. 4
      app/models/form/sales/questions/buyer2_live_in_property.rb
  31. 4
      app/models/form/sales/questions/buyer2_living_in.rb
  32. 4
      app/models/form/sales/questions/buyer2_mortgage.rb
  33. 4
      app/models/form/sales/questions/buyer2_nationality.rb
  34. 4
      app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
  35. 4
      app/models/form/sales/questions/buyer2_working_situation.rb
  36. 4
      app/models/form/sales/questions/buyer_company.rb
  37. 4
      app/models/form/sales/questions/buyer_interview.rb
  38. 4
      app/models/form/sales/questions/buyer_live.rb
  39. 4
      app/models/form/sales/questions/buyer_previous.rb
  40. 4
      app/models/form/sales/questions/buyer_still_serving.rb
  41. 8
      app/models/form/sales/questions/buyers_organisations.rb
  42. 4
      app/models/form/sales/questions/county.rb
  43. 16
      app/models/form/sales/questions/deposit_amount.rb
  44. 4
      app/models/form/sales/questions/deposit_discount.rb
  45. 4
      app/models/form/sales/questions/discount.rb
  46. 4
      app/models/form/sales/questions/discounted_ownership_type.rb
  47. 4
      app/models/form/sales/questions/equity.rb
  48. 4
      app/models/form/sales/questions/exchange_date.rb
  49. 16
      app/models/form/sales/questions/extra_borrowing.rb
  50. 4
      app/models/form/sales/questions/fromprop.rb
  51. 4
      app/models/form/sales/questions/gender_identity1.rb
  52. 4
      app/models/form/sales/questions/gender_identity2.rb
  53. 4
      app/models/form/sales/questions/grant.rb
  54. 4
      app/models/form/sales/questions/handover_date.rb
  55. 4
      app/models/form/sales/questions/has_leasehold_charges.rb
  56. 4
      app/models/form/sales/questions/household_disability.rb
  57. 4
      app/models/form/sales/questions/household_wheelchair.rb
  58. 4
      app/models/form/sales/questions/housing_benefits.rb
  59. 4
      app/models/form/sales/questions/joint_purchase.rb
  60. 4
      app/models/form/sales/questions/la_nominations.rb
  61. 16
      app/models/form/sales/questions/leasehold_charges.rb
  62. 14
      app/models/form/sales/questions/living_before_purchase.rb
  63. 14
      app/models/form/sales/questions/living_before_purchase_years.rb
  64. 5
      app/models/form/sales/questions/managing_organisation.rb
  65. 4
      app/models/form/sales/questions/monthly_rent.rb
  66. 16
      app/models/form/sales/questions/mortgage_amount.rb
  67. 16
      app/models/form/sales/questions/mortgage_lender.rb
  68. 18
      app/models/form/sales/questions/mortgage_length.rb
  69. 16
      app/models/form/sales/questions/mortgageused.rb
  70. 11
      app/models/form/sales/questions/nationality_all.rb
  71. 10
      app/models/form/sales/questions/nationality_all_group.rb
  72. 4
      app/models/form/sales/questions/number_joint_buyers.rb
  73. 4
      app/models/form/sales/questions/number_of_others_in_property.rb
  74. 4
      app/models/form/sales/questions/other_ownership_type.rb
  75. 4
      app/models/form/sales/questions/outright_ownership_type.rb
  76. 4
      app/models/form/sales/questions/ownership_scheme.rb
  77. 3
      app/models/form/sales/questions/owning_organisation_id.rb
  78. 14
      app/models/form/sales/questions/person_age.rb
  79. 14
      app/models/form/sales/questions/person_age_known.rb
  80. 14
      app/models/form/sales/questions/person_gender_identity.rb
  81. 14
      app/models/form/sales/questions/person_relationship_to_buyer_1.rb
  82. 14
      app/models/form/sales/questions/person_working_situation.rb
  83. 4
      app/models/form/sales/questions/postcode_for_full_address.rb
  84. 4
      app/models/form/sales/questions/previous_bedrooms.rb
  85. 4
      app/models/form/sales/questions/previous_la_known.rb
  86. 4
      app/models/form/sales/questions/previous_postcode.rb
  87. 4
      app/models/form/sales/questions/previous_postcode_known.rb
  88. 4
      app/models/form/sales/questions/previous_tenure.rb
  89. 4
      app/models/form/sales/questions/previous_tenure_buyer2.rb
  90. 4
      app/models/form/sales/questions/prevloc.rb
  91. 4
      app/models/form/sales/questions/prevown.rb
  92. 4
      app/models/form/sales/questions/prevshared.rb
  93. 4
      app/models/form/sales/questions/privacy_notice.rb
  94. 4
      app/models/form/sales/questions/property_building_type.rb
  95. 4
      app/models/form/sales/questions/property_local_authority.rb
  96. 4
      app/models/form/sales/questions/property_local_authority_known.rb
  97. 4
      app/models/form/sales/questions/property_number_of_bedrooms.rb
  98. 4
      app/models/form/sales/questions/property_unit_type.rb
  99. 4
      app/models/form/sales/questions/property_wheelchair_accessible.rb
  100. 14
      app/models/form/sales/questions/purchase_price.rb
  101. Some files were not shown because too many files have changed in this diff Show More

4
app/models/form/sales/pages/address.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address"
@header = "Q15 - What is the property's address?"
@header = "Q#{QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]} - What is the property's address?"
@depends_on = [
{ "uprn_known" => nil },
{ "uprn_known" => 0 },
@ -19,4 +19,6 @@ class Form::Sales::Pages::Address < ::Form::Page
Form::Sales::Questions::PostcodeForFullAddress.new(nil, nil, self),
]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
@plain_label = true
@check_answer_label = "Address lines 1 and 2"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = 15
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
end
@ -18,4 +18,6 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
log.address_line2,
].select(&:present?).join("\n")
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze
end

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

@ -20,6 +20,8 @@ class Form::Sales::Questions::Age1 < ::Form::Question
@min = 16
@max = 110
@step = 1
@question_number = 20
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 22 }.freeze
end

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

@ -14,6 +14,8 @@ class Form::Sales::Questions::Age2 < ::Form::Question
@max = 110
@min = 0
@step = 1
@question_number = 28
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 30 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::ArmedForces < ::Form::Question
@type = "radio"
@hint_text = "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces"
@answer_options = ANSWER_OPTIONS
@question_number = 62
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -16,4 +16,6 @@ class Form::Sales::Questions::ArmedForces < ::Form::Question
"3" => { "value" => "Buyer prefers not to say" },
"8" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 62, 2024 => 64 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::ArmedForcesSpouse < ::Form::Question
@header = "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 64
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::ArmedForcesSpouse < ::Form::Question
"6" => { "value" => "Buyer prefers not to say" },
"7" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 64, 2024 => 66 }.freeze
end

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

@ -24,7 +24,7 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question
],
}
@check_answers_card_number = 1
@question_number = 20
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -32,4 +32,6 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question
"1" => { "value" => "No" },
"2" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 22 }.freeze
end

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

@ -8,11 +8,13 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 23
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"19" => { "value" => "Arab" },
"16" => { "value" => "Other ethnic group" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 25 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 23
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -18,4 +18,6 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question
"9" => { "value" => "Pakistani" },
"11" => { "value" => "Any other Asian or Asian British background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 25 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 23
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -16,4 +16,6 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question
"12" => { "value" => "Caribbean" },
"14" => { "value" => "Any other Black, African, Caribbean or Black British background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 25 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 23
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -17,4 +17,6 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question
"6" => { "value" => "White and Asian" },
"7" => { "value" => "Any other Mixed or Multiple ethnic background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 25 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
@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
@question_number = 23
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options
@ -28,4 +28,6 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
}.freeze
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 25 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 22
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -20,4 +20,6 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question
"divider" => { "value" => true },
"17" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 22, 2024 => 24 }.freeze
end

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

@ -12,6 +12,8 @@ class Form::Sales::Questions::Buyer1Income < ::Form::Question
@width = 5
@prefix = "£"
@check_answers_card_number = 1
@question_number = 67
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 69 }.freeze
end

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question
"income1" => [0],
}
@check_answers_card_number = 1
@question_number = 67
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hidden_in_check_answers = {
"depends_on" => [
{
@ -24,4 +24,6 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 69 }.freeze
end

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

@ -8,11 +8,13 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question
@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."
@check_answers_card_number = 1
@question_number = 26
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 26, 2024 => 28 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer1Mortgage < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1
@question_number = 68
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -22,4 +22,6 @@ class Form::Sales::Questions::Buyer1Mortgage < ::Form::Question
"2" => { "value" => "No" },
}
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 68, 2024 => 70 }.freeze
end

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

@ -14,7 +14,7 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 24
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -24,4 +24,6 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question
"12" => { "value" => "Other" },
"13" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 24, 2024 => 26 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
@header = "What was buyer 1’s previous tenure?"
@type = "radio"
@answer_options = answer_options
@question_number = 56
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options
@ -22,4 +22,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
"0" => { "value" => "Don’t know" },
}
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 56, 2024 => 58 }.freeze
end

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

@ -14,7 +14,7 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 25
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -29,4 +29,6 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question
"10" => { "value" => "Buyer prefers not to say" },
"7" => { "value" => "Full-time student" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 25, 2024 => 27 }.freeze
end

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

@ -20,11 +20,13 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question
],
}
@check_answers_card_number = 2
@question_number = 28
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 30 }.freeze
end

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

@ -7,11 +7,13 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 31
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"19" => { "value" => "Arab" },
"16" => { "value" => "Other ethnic group" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 33 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 31
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -17,4 +17,6 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question
"9" => { "value" => "Pakistani" },
"11" => { "value" => "Any other Asian or Asian British background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 33 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 31
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question
"12" => { "value" => "Caribbean" },
"14" => { "value" => "Any other Black, African, Caribbean or Black British background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 33 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 31
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -16,4 +16,6 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question
"6" => { "value" => "White and Asian" },
"7" => { "value" => "Any other Mixed or Multiple ethnic background" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 33 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
@header = "Which of the following best describes buyer 2’s White background?"
@type = "radio"
@check_answers_card_number = 2
@question_number = 31
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options
@ -27,4 +27,6 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
}.freeze
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 33 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 30
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -19,4 +19,6 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question
"divider" => { "value" => true },
"17" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 30, 2024 => 32 }.freeze
end

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

@ -12,6 +12,8 @@ class Form::Sales::Questions::Buyer2Income < ::Form::Question
@width = 5
@prefix = "£"
@check_answers_card_number = 2
@question_number = 69
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 71 }.freeze
end

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question
"income2" => [0],
}
@check_answers_card_number = 2
@question_number = 69
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hidden_in_check_answers = {
"depends_on" => [
{
@ -24,4 +24,6 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 71 }.freeze
end

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

@ -7,11 +7,13 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 34
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 34, 2024 => 36 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
@type = "radio"
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = 60
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 60, 2024 => 62 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2Mortgage < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 70
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -22,4 +22,6 @@ class Form::Sales::Questions::Buyer2Mortgage < ::Form::Question
"2" => { "value" => "No" },
}
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 70, 2024 => 72 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@question_number = 32
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@inferred_check_answers_value = [{
"condition" => {
"national" => 13,
@ -23,4 +23,6 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question
"12" => { "value" => "Other" },
"13" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 34 }.freeze
end

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

@ -13,7 +13,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 27
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -22,4 +22,6 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
"X" => { "value" => "Other" },
"R" => { "value" => "Buyer prefers not to say" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 29 }.freeze
end

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

@ -13,7 +13,7 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 33
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -29,4 +29,6 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question
"7" => { "value" => "Full-time student" },
"9" => { "value" => "Child under 16" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 35 }.freeze
end

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

@ -6,11 +6,13 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question
@header = "Is the buyer a company?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 7
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 7, 2024 => 9 }.freeze
end

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

@ -7,11 +7,13 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
@type = "radio"
@hint_text = "You should still try to answer all questions even if the #{joint_purchase ? 'buyers weren’t' : 'buyer wasn’t'} interviewed in person"
@answer_options = ANSWER_OPTIONS
@question_number = 18
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"2" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 18, 2024 => 13 }.freeze
end

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

@ -6,11 +6,13 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question
@header = form.start_year_after_2024? ? "Will any buyers live in the property?" : "Will the buyers live in the property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 8
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 8, 2024 => 10 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
@header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1)
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 84
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -25,4 +25,6 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
def derived?
form.start_year_after_2024?
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::BuyerStillServing < ::Form::Question
@header = "Is the buyer still serving in the UK armed forces?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 63
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::BuyerStillServing < ::Form::Question
"6" => { "value" => "Buyer prefers not to say" },
"7" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 63, 2024 => 65 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
@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
@question_number = 59
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -26,4 +26,10 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
"pregghb" => { "value" => "Help to Buy Agent" },
}
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
end

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

@ -7,7 +7,9 @@ class Form::Sales::Questions::County < ::Form::Question
@plain_label = true
@check_answer_label = "County"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = 15
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze
end

16
app/models/form/sales/questions/deposit_amount.rb

@ -12,7 +12,7 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
@prefix = "£"
@derived = true
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@optional = optional
end
@ -20,16 +20,10 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
true
end
def question_number
case @ownershipsch
when 1
95
when 2
108
when 3
116
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 95, 2 => 108, 3 => 116 },
2024 => { 1 => 96, 2 => 109, 3 => 116 },
}.freeze
def hint_text
if @optional

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

@ -11,6 +11,8 @@ class Form::Sales::Questions::DepositDiscount < ::Form::Question
@width = 5
@prefix = "£"
@hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
@question_number = 96
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 97 }.freeze
end

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

@ -13,6 +13,8 @@ class Form::Sales::Questions::Discount < ::Form::Question
@hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>
If discount capped, enter capped %</br></br>
If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
@question_number = 102
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 102, 2024 => 103 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question
@type = "radio"
@top_guidance_partial = guidance_partial
@answer_options = ANSWER_OPTIONS
@question_number = 5
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -23,4 +23,6 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question
def guidance_partial
"discounted_ownership_type_definitions" if form.start_date.year >= 2023
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7 }.freeze
end

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

@ -11,6 +11,8 @@ class Form::Sales::Questions::Equity < ::Form::Question
@width = 5
@suffix = "%"
@hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
@question_number = 89
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 90 }.freeze
end

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

@ -5,6 +5,8 @@ class Form::Sales::Questions::ExchangeDate < ::Form::Question
@check_answer_label = "Exchange of contracts date"
@header = "What is the exchange of contracts date?"
@type = "date"
@question_number = 81
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 83 }.freeze
end

16
app/models/form/sales/questions/extra_borrowing.rb

@ -9,7 +9,7 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question
@page = page
@hint_text = ""
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
ANSWER_OPTIONS = {
@ -18,14 +18,8 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question
"3" => { "value" => "Don't know" },
}.freeze
def question_number
case @ownershipsch
when 1
94
when 2
107
when 3
115
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 94, 2 => 107, 3 => 115 },
2024 => { 1 => 95, 2 => 108, 3 => 115 },
}.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Fromprop < ::Form::Question
@hint_text = ""
@page = page
@answer_options = ANSWER_OPTIONS
@question_number = 86
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -29,4 +29,6 @@ class Form::Sales::Questions::Fromprop < ::Form::Question
"9" => { "value" => "Other" },
}
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 86, 2024 => 87 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1
@question_number = 21
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -24,4 +24,6 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
"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
end

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

@ -13,7 +13,7 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 29
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -28,4 +28,6 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
"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
end

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

@ -11,6 +11,8 @@ class Form::Sales::Questions::Grant < ::Form::Question
@width = 5
@prefix = "£"
@hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
@question_number = 101
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 101, 2024 => 102 }.freeze
end

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

@ -6,6 +6,8 @@ class Form::Sales::Questions::HandoverDate < ::Form::Question
@header = "What is the practical completion or handover date?"
@type = "date"
@hint_text = "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
@question_number = 82
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 84 }.freeze
end

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

@ -29,9 +29,9 @@ class Form::Sales::Questions::HasLeaseholdCharges < ::Form::Question
def question_number
case @ownershipsch
when 1
98
99
when 2
109
110
when 3
117
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::HouseholdDisability < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "This includes any long-term health condition that has an impact on the person's day-to-day life"
@question_number = 65
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::HouseholdDisability < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 65, 2024 => 67 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "This can be inside or outside the home"
@question_number = 66
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -14,4 +14,6 @@ class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 66, 2024 => 68 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::HousingBenefits < ::Form::Question
@header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} receiving any of these housing-related benefits immediately before buying this property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 71
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -16,4 +16,6 @@ class Form::Sales::Questions::HousingBenefits < ::Form::Question
"1" => { "value" => "Neither housing benefit or Universal Credit housing element" },
"4" => { "value" => "Don’t know " },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 71, 2024 => 73 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question
@header = "Is this a joint purchase?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 9
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -19,4 +19,6 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question
"This is where two or more people are named as legal owners of the property after the purchase"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 11 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::LaNominations < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
@question_number = 83
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::LaNominations < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don’t know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 83, 2024 => 85 }.freeze
end

16
app/models/form/sales/questions/leasehold_charges.rb

@ -10,17 +10,11 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question
@width = 5
@prefix = "£"
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
def question_number
case @ownershipsch
when 1
98
when 2
109
when 3
117
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 98, 2 => 109, 3 => 117 },
2024 => { 1 => 99, 2 => 110, 3 => 117 },
}.freeze
end

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

@ -18,7 +18,7 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question
],
}
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
ANSWER_OPTIONS = {
@ -26,12 +26,8 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question
"1" => { "value" => "No" },
}.freeze
def question_number
case @ownershipsch
when 1
75
when 2
99
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 75, 2 => 99 },
2024 => { 1 => 77, 2 => 100 },
}.freeze
end

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

@ -30,16 +30,12 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question
end
end
def question_number
case @ownershipsch
when 1
75
when 2
99
end
end
def suffix_label(log)
" #{'year'.pluralize(log[id])}"
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 75, 2 => 99 },
2024 => { 1 => 77, 2 => 101 },
}.freeze
end

5
app/models/form/sales/questions/managing_organisation.rb

@ -5,6 +5,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question
@check_answer_label = "Reported by"
@header = "Which organisation is reporting this sale?"
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options(log = nil, user = nil)
@ -58,7 +59,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question
end
def hidden_in_check_answers?(log, user = nil)
user.nil? || !user.support? || !@page.routed_to?(log, user)
user.nil? || !@page.routed_to?(log, user)
end
def enabled
@ -74,4 +75,6 @@ private
def selected_answer_option_is_derived?(_log)
true
end
QUESTION_NUMBER_FROM_YEAR = { 2024 => 2 }.freeze
end

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

@ -10,6 +10,8 @@ class Form::Sales::Questions::MonthlyRent < ::Form::Question
@width = 5
@prefix = "£"
@hint_text = "Amount paid before any charges"
@question_number = 97
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 98 }.freeze
end

16
app/models/form/sales/questions/mortgage_amount.rb

@ -11,17 +11,11 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question
@prefix = "£"
@hint_text = "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
def question_number
case @ownershipsch
when 1
91
when 2
104
when 3
112
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 91, 2 => 104, 3 => 112 },
2024 => { 1 => 92, 2 => 105, 3 => 113 },
}.freeze
end

16
app/models/form/sales/questions/mortgage_lender.rb

@ -9,7 +9,7 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
@page = page
@bottom_guidance_partial = "mortgage_lender"
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
ANSWER_OPTIONS = {
@ -73,14 +73,8 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
answer_options.reject { |k, _v| OPTIONS_NOT_DISPLAYED.include?(k) }
end
def question_number
case @ownershipsch
when 1
92
when 2
105
when 3
113
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 92, 2 => 105, 3 => 113 },
2024 => { 1 => 93, 2 => 106 },
}.freeze
end

18
app/models/form/sales/questions/mortgage_length.rb

@ -11,21 +11,15 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question
@width = 5
@hint_text = "You should round up to the nearest year. Value should not exceed 60 years."
@ownershipsch = ownershipsch
@question_number = question_number
end
def question_number
case @ownershipsch
when 1
93
when 2
106
when 3
114
end
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
def suffix_label(log)
" #{'year'.pluralize(log[id])}"
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 93, 2 => 106, 3 => 114 },
2024 => { 1 => 94, 2 => 107, 3 => 114 },
}.freeze
end

16
app/models/form/sales/questions/mortgageused.rb

@ -7,7 +7,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@ownershipsch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
ANSWER_OPTIONS = {
@ -27,14 +27,8 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
end
end
def question_number
case @ownershipsch
when 1
90
when 2
103
when 3
111
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 1 => 90, 2 => 103, 3 => 111 },
2024 => { 1 => 91, 2 => 104, 3 => 112 },
}.freeze
end

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

@ -6,10 +6,19 @@ class Form::Sales::Questions::NationalityAll < ::Form::Question
@type = "select"
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@check_answers_card_number = buyer_index
@question_number = buyer_index == 1 ? 24 : 32
@buyer_index = buyer_index
@question_number = question_number
end
def answer_label(log, _current_user = nil)
answer_options[log.send(id).to_s]["name"]
end
def question_number
if form.start_date.year == 2023
@buyer_index == 1 ? 24 : 32
else
@buyer_index == 1 ? 26 : 34
end
end
end

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

@ -7,10 +7,10 @@ class Form::Sales::Questions::NationalityAllGroup < ::Form::Question
@hint_text = buyer_index == 1 ? "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
@check_answers_card_number = buyer_index
@question_number = buyer_index == 1 ? 24 : 32
@conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] }
@hidden_in_check_answers = { "depends_on" => [{ id => 12 }] }
@buyer_index = buyer_index
@question_number = question_number
end
ANSWER_OPTIONS = {
@ -26,4 +26,12 @@ class Form::Sales::Questions::NationalityAllGroup < ::Form::Question
"If buyer 2 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."
end
end
def question_number
if form.start_date.year == 2023
@buyer_index == 1 ? 24 : 32
else
@buyer_index == 1 ? 26 : 34
end
end
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question
@header = "Are there more than 2 joint buyers of this property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -22,4 +22,6 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question
"You should still try to answer all questions even if the buyers weren’t interviewed in person"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 12 }.freeze
end

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
@min = 0
@max = 15
@step = 1
@question_number = 35
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
private
@ -22,4 +22,6 @@ private
"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
end

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

@ -6,6 +6,8 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question
@header = "What type of sale is it?"
@type = "text"
@width = 10
@question_number = 6
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze
end

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question
@conditional_for = {
"othtype" => [12],
}
@question_number = 6
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -21,4 +21,6 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question
def guidance_partial
"outright_sale_type_definitions" if form.start_date.year >= 2023
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze
end

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question
@check_answer_label = "Purchase made under ownership scheme"
@header = "Was this purchase made through an ownership scheme?"
@type = "radio"
@question_number = 3
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options
@ -23,4 +23,6 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question
}.freeze
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 3, 2024 => 5 }.freeze
end

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

@ -5,6 +5,7 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question
@check_answer_label = "Owning organisation"
@header = "Which organisation owns this log?"
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
def answer_options(log = nil, user = nil)
@ -99,4 +100,6 @@ private
def merged_organisation_label(name, merge_date)
"#{name} (inactive as of #{merge_date.to_fs(:govuk_date)})"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => nil, 2024 => 1 }.freeze
end

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

@ -13,6 +13,18 @@ class Form::Sales::Questions::PersonAge < ::Form::Question
@min = 0
@max = 110
@step = 1
@question_number = 29 + (4 * person_index)
@person_index = person_index
@question_number = question_number
end
def question_number
base_question_number = case form.start_date.year
when 2023
29
else
31
end
base_question_number + (4 * @person_index)
end
end

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

@ -19,11 +19,23 @@ class Form::Sales::Questions::PersonAgeKnown < ::Form::Question
],
}
@check_answers_card_number = person_index
@question_number = 29 + (4 * person_index)
@person_index = person_index
@question_number = question_number
end
ANSWER_OPTIONS = {
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
def question_number
base_question_number = case form.start_date.year
when 2023
29
else
31
end
base_question_number + (4 * @person_index)
end
end

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

@ -12,7 +12,8 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 30 + (4 * person_index)
@person_index = person_index
@question_number = question_number
end
ANSWER_OPTIONS = {
@ -27,4 +28,15 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
"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
base_question_number = case form.start_date.year
when 2023
30
else
32
end
base_question_number + (4 * @person_index)
end
end

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

@ -12,7 +12,8 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 28 + (4 * person_index)
@person_index = person_index
@question_number = question_number
end
ANSWER_OPTIONS = {
@ -21,4 +22,15 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
"X" => { "value" => "Other" },
"R" => { "value" => "Person prefers not to say" },
}.freeze
def question_number
base_question_number = case form.start_date.year
when 2023
28
else
30
end
base_question_number + (4 * @person_index)
end
end

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

@ -12,7 +12,8 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question
},
"value" => "Prefers not to say",
}]
@question_number = 31 + (4 * person_index)
@person_index = person_index
@question_number = question_number
end
ANSWER_OPTIONS = {
@ -28,4 +29,15 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question
"7" => { "value" => "Full-time student" },
"9" => { "value" => "Child under 16" },
}.freeze
def question_number
base_question_number = case form.start_date.year
when 2023
31
else
33
end
base_question_number + (4 * @person_index)
end
end

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

@ -19,7 +19,9 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
@plain_label = true
@check_answer_label = "Postcode"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = 15
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze
end

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

@ -10,6 +10,8 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question
@max = 6
@step = 1
@hint_text = "For bedsits enter 1"
@question_number = 85
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 86 }.freeze
end

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question
@conditional_for = {
"prevloc" => [1],
}
@question_number = 58
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
@ -28,4 +28,6 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question
"1" => { "value" => "Yes" },
"0" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 58, 2024 => 60 }.freeze
end

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

@ -17,7 +17,9 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question
"is_previous_la_inferred" => true,
},
}
@question_number = 57
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 57, 2024 => 59 }.freeze
end

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
},
],
}
@question_number = 57
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
@ -28,4 +28,6 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 57, 2024 => 59 }.freeze
end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question
@hint_text = ""
@page = page
@answer_options = ANSWER_OPTIONS
@question_number = 87
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -18,4 +18,6 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question
"9" => { "value" => "Other" },
"10" => { "value" => "Don’t know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 87, 2024 => 88 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
@type = "radio"
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = 61
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -21,4 +21,6 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
"9" => { "value" => "Other" },
"0" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 61, 2024 => 63 }.freeze
end

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

@ -11,11 +11,13 @@ class Form::Sales::Questions::Prevloc < ::Form::Question
},
"value" => "Not known",
}]
@question_number = 58
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
def answer_options
{ "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).map { |la| [la.code, la.name] }.to_h)
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 58, 2024 => 60 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::Prevown < ::Form::Question
@header = I18n.t("questions.prevown", count: joint_purchase ? 2 : 1)
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 73
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -14,4 +14,6 @@ class Form::Sales::Questions::Prevown < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don’t know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 73, 2024 => 75 }.freeze
end

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Prevshared < ::Form::Question
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "For any buyer"
@question_number = 74
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -15,4 +15,6 @@ class Form::Sales::Questions::Prevshared < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don’t know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 74, 2024 => 76 }.freeze
end

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
@check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?"
@header = "Declaration"
@type = "checkbox"
@question_number = 19
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@joint_purchase = joint_purchase
@top_guidance_partial = guidance
end
@ -27,4 +27,6 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
@joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 19, 2024 => 14 }.freeze
end

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

@ -6,11 +6,13 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question
@header = "What type of building is the property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 13
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Purpose built" },
"2" => { "value" => "Converted from previous residential or non-residential property" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 20 }.freeze
end

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question
@check_answer_label = "Local authority"
@header = "What is the property’s local authority?"
@type = "select"
@question_number = 16
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
@ -16,4 +16,6 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question
def hidden_in_check_answers?(log, _current_user = nil)
log.saledate && log.saledate.year >= 2023 && log.is_la_inferred?
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze
end

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

@ -14,11 +14,13 @@ class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question
},
],
}
@question_number = 16
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"0" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze
end

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

@ -10,6 +10,8 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
@min = 1
@max = 9
@step = 1
@question_number = 11
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 18 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question
@header = "What type of unit is the property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 12
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
@ -16,4 +16,6 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question
"4" => { "value" => "Bungalow" },
"9" => { "value" => "Other" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 19 }.freeze
end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
@header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = 17
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : nil
end
@ -15,4 +15,6 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
"2" => { "value" => "No" },
"3" => { "value" => "Don't know" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 21 }.freeze
end

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

@ -11,17 +11,13 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
@prefix = "£"
@hint_text = hint_text
@ownership_sch = ownershipsch
@question_number = question_number
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
def question_number
case @ownership_sch
when 2 # discounted ownership scheme
100
when 3 # outright sale
110
end
end
QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {
2023 => { 2 => 100, 3 => 110 },
2024 => { 2 => 101, 3 => 111 },
}.freeze
def hint_text
return if @ownership_sch == 3 # outright sale

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

Loading…
Cancel
Save