Browse Source

Add a default question number

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

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
@plain_label = true @plain_label = true
@check_answer_label = "Address lines 1 and 2" @check_answer_label = "Address lines 1 and 2"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@hide_question_number_on_page = true @hide_question_number_on_page = true
end end

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::Age1 < ::Form::Question
@min = 16 @min = 16
@max = 110 @max = 110
@step = 1 @step = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 22 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 22 }.freeze

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

@ -14,7 +14,7 @@ class Form::Sales::Questions::Age2 < ::Form::Question
@max = 110 @max = 110
@min = 0 @min = 0
@step = 1 @step = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 30 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 30 }.freeze

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::ArmedForces < ::Form::Question
@type = "radio" @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" @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @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" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question
@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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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 @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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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 @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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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 @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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
@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." @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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options def answer_options

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question
@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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -12,7 +12,7 @@ class Form::Sales::Questions::Buyer1Income < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @prefix = "£"
@check_answers_card_number = 1 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 69 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 69 }.freeze

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question
"income1" => [0], "income1" => [0],
} }
@check_answers_card_number = 1 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question
@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." @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 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer1Mortgage < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -14,7 +14,7 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question
}, },
"value" => "Prefers not to say", "value" => "Prefers not to say",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "What was buyer 1’s previous tenure?"
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options def answer_options

2
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", "value" => "Prefers not to say",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question
], ],
} }
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options def answer_options

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -12,7 +12,7 @@ class Form::Sales::Questions::Buyer2Income < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @prefix = "£"
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 71 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 71 }.freeze

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question
"income2" => [0], "income2" => [0],
} }
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
@type = "radio" @type = "radio"
@hint_text = "" @hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2Mortgage < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {
"national" => 13, "national" => 13,

2
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", "value" => "Prefers not to say",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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", "value" => "Prefers not to say",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question
@header = "Is the buyer a company?" @header = "Is the buyer a company?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
@type = "radio" @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" @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -6,7 +6,7 @@ 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?" @header = form.start_year_after_2024? ? "Will any buyers live in the property?" : "Will the buyers live in the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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) @header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1)
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "Is the buyer still serving in the UK armed forces?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
@type = "checkbox" @type = "checkbox"
@hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." @hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::County < ::Form::Question
@plain_label = true @plain_label = true
@check_answer_label = "County" @check_answer_label = "County"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@hide_question_number_on_page = true @hide_question_number_on_page = true
end end

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

@ -12,7 +12,7 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
@prefix = "£" @prefix = "£"
@derived = true @derived = true
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@optional = optional @optional = optional
end end

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::DepositDiscount < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @prefix = "£"
@hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme" @hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 98 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 98 }.freeze

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

@ -13,7 +13,7 @@ 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> @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 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." 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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 102, 2024 => 104 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 102, 2024 => 104 }.freeze

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question
@type = "radio" @type = "radio"
@top_guidance_partial = guidance_partial @top_guidance_partial = guidance_partial
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::Equity < ::Form::Question
@width = 5 @width = 5
@suffix = "%" @suffix = "%"
@hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)" @hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 91 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 91 }.freeze

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::ExchangeDate < ::Form::Question
@check_answer_label = "Exchange of contracts date" @check_answer_label = "Exchange of contracts date"
@header = "What is the exchange of contracts date?" @header = "What is the exchange of contracts date?"
@type = "date" @type = "date"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 83 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 83 }.freeze

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

@ -9,7 +9,7 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question
@page = page @page = page
@hint_text = "" @hint_text = ""
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::Fromprop < ::Form::Question
@hint_text = "" @hint_text = ""
@page = page @page = page
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -13,7 +13,7 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
}, },
"value" => "Prefers not to say", "value" => "Prefers not to say",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::Grant < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @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" @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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 101, 2024 => 103 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 101, 2024 => 103 }.freeze

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::HandoverDate < ::Form::Question
@header = "What is the practical completion or handover date?" @header = "What is the practical completion or handover date?"
@type = "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)" @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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 84 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 84 }.freeze

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::HouseholdDisability < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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" @hint_text = "This includes any long-term health condition that has an impact on the person's day-to-day life"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "This can be inside or outside the home" @hint_text = "This can be inside or outside the home"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} receiving any of these housing-related benefits immediately before buying this property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "Is this a joint purchase?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::LaNominations < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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" @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 = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @prefix = "£"
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = { QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {

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

@ -18,7 +18,7 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question
], ],
} }
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question
@check_answer_label = "Reported by" @check_answer_label = "Reported by"
@header = "Which organisation is reporting this sale?" @header = "Which organisation is reporting this sale?"
@type = "select" @type = "select"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options(log = nil, user = nil) def answer_options(log = nil, user = nil)

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::MonthlyRent < ::Form::Question
@width = 5 @width = 5
@prefix = "£" @prefix = "£"
@hint_text = "Amount paid before any charges" @hint_text = "Amount paid before any charges"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 99 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 99 }.freeze

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question
@prefix = "£" @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." @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 @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = { QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {

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

@ -9,7 +9,7 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
@page = page @page = page
@bottom_guidance_partial = "mortgage_lender" @bottom_guidance_partial = "mortgage_lender"
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question
@width = 5 @width = 5
@hint_text = "You should round up to the nearest year. Value should not exceed 60 years." @hint_text = "You should round up to the nearest year. Value should not exceed 60 years."
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
def suffix_label(log) def suffix_label(log)

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ownershipsch = ownershipsch @ownershipsch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "Are there more than 2 joint buyers of this property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
@min = 0 @min = 0
@max = 15 @max = 15
@step = 1 @step = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
private private

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question
@header = "What type of sale is it?" @header = "What type of sale is it?"
@type = "text" @type = "text"
@width = 10 @width = 10
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question
@conditional_for = { @conditional_for = {
"othtype" => [12], "othtype" => [12],
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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" @check_answer_label = "Purchase made under ownership scheme"
@header = "Was this purchase made through an ownership scheme?" @header = "Was this purchase made through an ownership scheme?"
@type = "radio" @type = "radio"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options def answer_options

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question
@check_answer_label = "Owning organisation" @check_answer_label = "Owning organisation"
@header = "Which organisation owns this log?" @header = "Which organisation owns this log?"
@type = "select" @type = "select"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def answer_options(log = nil, user = nil) def answer_options(log = nil, user = nil)
@ -101,5 +101,5 @@ private
"#{name} (inactive as of #{merge_date.to_fs(:govuk_date)})" "#{name} (inactive as of #{merge_date.to_fs(:govuk_date)})"
end end
QUESION_NUMBER_FROM_YEAR = { 2024 => 1 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => nil, 2024 => 1 }.freeze
end end

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

@ -19,7 +19,7 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
@plain_label = true @plain_label = true
@check_answer_label = "Postcode" @check_answer_label = "Postcode"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@hide_question_number_on_page = true @hide_question_number_on_page = true
end end

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question
@max = 6 @max = 6
@step = 1 @step = 1
@hint_text = "For bedsits enter 1" @hint_text = "For bedsits enter 1"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 87 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 87 }.freeze

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question
@conditional_for = { @conditional_for = {
"prevloc" => [1], "prevloc" => [1],
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -17,7 +17,7 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question
"is_previous_la_inferred" => true, "is_previous_la_inferred" => true,
}, },
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -20,7 +20,7 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
}, },
], ],
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -8,7 +8,7 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question
@hint_text = "" @hint_text = ""
@page = page @page = page
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
@type = "radio" @type = "radio"
@hint_text = "" @hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question
}, },
"value" => "Not known", "value" => "Not known",
}] }]
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

2
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) @header = I18n.t("questions.prevown", count: joint_purchase ? 2 : 1)
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Prevshared < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "For any buyer" @hint_text = "For any buyer"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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?" @check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?"
@header = "Declaration" @header = "Declaration"
@type = "checkbox" @type = "checkbox"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@joint_purchase = joint_purchase @joint_purchase = joint_purchase
@top_guidance_partial = guidance @top_guidance_partial = guidance
end end
@ -27,6 +27,6 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
@joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer" @joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer"
end end
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 19, 2024 => 14 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 19, 2024 => 14 }.freeze
end end

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question
@header = "What type of building is the property?" @header = "What type of building is the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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" @check_answer_label = "Local authority"
@header = "What is the property’s local authority?" @header = "What is the property’s local authority?"
@type = "select" @type = "select"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -14,7 +14,7 @@ class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question
}, },
], ],
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
@min = 1 @min = 1
@max = 9 @max = 9
@step = 1 @step = 1
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 15 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 15 }.freeze

2
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?" @header = "What type of unit is the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

2
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?" @header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
@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 @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 end

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
@prefix = "£" @prefix = "£"
@hint_text = hint_text @hint_text = hint_text
@ownership_sch = ownershipsch @ownership_sch = ownershipsch
@question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year][ownershipsch] if QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP[form.start_date.year].present? @question_number = QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end end
QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = { QUESION_NUMBER_FROM_YEAR_AND_OWNERSHIP = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question
@hint_text = "This is how you usually refer to the purchaser on your own systems." @hint_text = "This is how you usually refer to the purchaser on your own systems."
@type = "text" @type = "text"
@width = 10 @width = 10
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 2, 2024 => 4 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 2, 2024 => 4 }.freeze

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Resale < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'." @hint_text = "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::SaleDate < ::Form::Question
@check_answer_label = "Sale completion date" @check_answer_label = "Sale completion date"
@header = "What is the sale completion date?" @header = "What is the sale completion date?"
@type = "date" @type = "date"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 1, 2024 => 3 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 1, 2024 => 3 }.freeze

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

@ -9,7 +9,7 @@ class Form::Sales::Questions::Savings < ::Form::Question
@prefix = "£" @prefix = "£"
@step = 10 @step = 10
@min = 0 @min = 0
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 72, 2024 => 74 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 72, 2024 => 74 }.freeze

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

@ -16,7 +16,7 @@ class Form::Sales::Questions::SavingsNk < ::Form::Question
}, },
], ],
} }
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question
@top_guidance_partial = guidance_partial @top_guidance_partial = guidance_partial
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
def hint_text def hint_text

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::Staircase < ::Form::Question
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property" @hint_text = "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question
@max = 100 @max = 100
@step = 1 @step = 1
@suffix = "%" @suffix = "%"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 79 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 79 }.freeze

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::StaircaseOwned < ::Form::Question
@max = 100 @max = 100
@step = 1 @step = 1
@suffix = "%" @suffix = "%"
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
QUESION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 80 }.freeze QUESION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 80 }.freeze

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::StaircaseSale < ::Form::Question
@header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?" @header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESION_NUMBER_FROM_YEAR[form.start_date.year] @question_number = QUESION_NUMBER_FROM_YEAR.fetch(form.start_date.year, QUESION_NUMBER_FROM_YEAR.max_by { |k, _v| k }.last)
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

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

Loading…
Cancel
Save