Browse Source

Rename method 'start_year_after_2024?' to better reflect what it does as 'start_year_2024_or_later?'

pull/2751/head
Manny Dinssa 9 months ago
parent
commit
3463fd6a6f
  1. 4
      app/models/derived_variables/lettings_log_variables.rb
  2. 4
      app/models/derived_variables/sales_log_variables.rb
  3. 9
      app/models/form.rb
  4. 4
      app/models/form/lettings/pages/lead_tenant_nationality.rb
  5. 4
      app/models/form/lettings/pages/property_local_authority.rb
  6. 4
      app/models/form/lettings/pages/uprn.rb
  7. 2
      app/models/form/lettings/questions/age.rb
  8. 6
      app/models/form/lettings/questions/declaration.rb
  9. 2
      app/models/form/lettings/questions/ethnic_white.rb
  10. 4
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  11. 2
      app/models/form/lettings/questions/housingneeds_other.rb
  12. 2
      app/models/form/lettings/questions/is_carehome.rb
  13. 2
      app/models/form/lettings/questions/layear.rb
  14. 2
      app/models/form/lettings/questions/letting_allocation.rb
  15. 2
      app/models/form/lettings/questions/person_relationship.rb
  16. 2
      app/models/form/lettings/questions/previous_let_type.rb
  17. 2
      app/models/form/lettings/questions/reason.rb
  18. 2
      app/models/form/lettings/questions/reason_renewal.rb
  19. 2
      app/models/form/lettings/questions/referral.rb
  20. 2
      app/models/form/lettings/questions/referral_prp.rb
  21. 2
      app/models/form/lettings/questions/referral_supported_housing.rb
  22. 2
      app/models/form/lettings/questions/referral_supported_housing_prp.rb
  23. 2
      app/models/form/lettings/questions/rent_type.rb
  24. 2
      app/models/form/lettings/questions/rsnvac.rb
  25. 2
      app/models/form/lettings/questions/sheltered.rb
  26. 2
      app/models/form/lettings/questions/starter_tenancy_type.rb
  27. 2
      app/models/form/lettings/questions/tenancy_type.rb
  28. 2
      app/models/form/lettings/questions/uprn_confirmation.rb
  29. 2
      app/models/form/lettings/questions/waityear.rb
  30. 44
      app/models/form/lettings/subsections/household_characteristics.rb
  31. 2
      app/models/form/lettings/subsections/household_situation.rb
  32. 4
      app/models/form/lettings/subsections/property_information.rb
  33. 2
      app/models/form/lettings/subsections/setup.rb
  34. 2
      app/models/form/lettings/subsections/tenancy_information.rb
  35. 2
      app/models/form/sales/pages/buyer1_nationality.rb
  36. 2
      app/models/form/sales/pages/buyer2_nationality.rb
  37. 2
      app/models/form/sales/pages/buyer_previous.rb
  38. 2
      app/models/form/sales/pages/deposit.rb
  39. 2
      app/models/form/sales/pages/deposit_discount.rb
  40. 2
      app/models/form/sales/pages/la_nominations.rb
  41. 2
      app/models/form/sales/pages/last_accommodation.rb
  42. 2
      app/models/form/sales/pages/last_accommodation_la.rb
  43. 2
      app/models/form/sales/pages/managing_organisation.rb
  44. 4
      app/models/form/sales/pages/property_local_authority.rb
  45. 4
      app/models/form/sales/pages/uprn.rb
  46. 2
      app/models/form/sales/questions/buyer1_ethnic_background_white.rb
  47. 2
      app/models/form/sales/questions/buyer2_ethnic_background_white.rb
  48. 2
      app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
  49. 2
      app/models/form/sales/questions/buyer_previous.rb
  50. 2
      app/models/form/sales/questions/discount.rb
  51. 2
      app/models/form/sales/questions/mortgage_lender.rb
  52. 2
      app/models/form/sales/questions/mortgageused.rb
  53. 2
      app/models/form/sales/questions/ownership_scheme.rb
  54. 2
      app/models/form/sales/questions/person_relationship_to_buyer_1.rb
  55. 4
      app/models/form/sales/questions/privacy_notice.rb
  56. 2
      app/models/form/sales/questions/uprn_confirmation.rb
  57. 66
      app/models/form/sales/subsections/household_characteristics.rb
  58. 4
      app/models/form/sales/subsections/outright_sale.rb
  59. 2
      app/models/form/sales/subsections/property_information.rb
  60. 8
      app/models/form/sales/subsections/setup.rb
  61. 4
      app/models/form/sales/subsections/shared_ownership_scheme.rb
  62. 4
      app/models/lettings_log.rb
  63. 6
      app/models/sales_log.rb
  64. 10
      app/models/validations/household_validations.rb
  65. 2
      app/models/validations/property_validations.rb
  66. 4
      app/models/validations/sales/financial_validations.rb
  67. 12
      app/models/validations/sales/household_validations.rb
  68. 2
      app/models/validations/sales/property_validations.rb
  69. 18
      app/models/validations/sales/sale_information_validations.rb
  70. 4
      app/models/validations/sales/soft_validations.rb
  71. 2
      app/models/validations/shared_validations.rb
  72. 4
      app/services/exports/lettings_log_export_service.rb
  73. 2
      spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb
  74. 2
      spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb
  75. 2
      spec/models/form/lettings/pages/person_age_spec.rb
  76. 2
      spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb
  77. 2
      spec/models/form/lettings/pages/previous_local_authority_spec.rb
  78. 2
      spec/models/form/lettings/pages/previous_postcode_spec.rb
  79. 4
      spec/models/form/lettings/pages/property_local_authority_spec.rb
  80. 2
      spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb
  81. 2
      spec/models/form/lettings/pages/renewal_spec.rb
  82. 2
      spec/models/form/lettings/pages/rent_type_spec.rb
  83. 2
      spec/models/form/lettings/pages/starter_tenancy_type_spec.rb
  84. 4
      spec/models/form/lettings/pages/uprn_spec.rb
  85. 2
      spec/models/form/lettings/questions/age1_known_spec.rb
  86. 2
      spec/models/form/lettings/questions/age_spec.rb
  87. 6
      spec/models/form/lettings/questions/declaration_spec.rb
  88. 4
      spec/models/form/lettings/questions/ethnic_white_spec.rb
  89. 4
      spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb
  90. 2
      spec/models/form/lettings/questions/gender_identity1_spec.rb
  91. 2
      spec/models/form/lettings/questions/hb_spec.rb
  92. 4
      spec/models/form/lettings/questions/housingneeds_other_spec.rb
  93. 4
      spec/models/form/lettings/questions/is_carehome_spec.rb
  94. 2
      spec/models/form/lettings/questions/joint_spec.rb
  95. 4
      spec/models/form/lettings/questions/layear_spec.rb
  96. 4
      spec/models/form/lettings/questions/letting_allocation_spec.rb
  97. 2
      spec/models/form/lettings/questions/person_relationship_spec.rb
  98. 2
      spec/models/form/lettings/questions/ppcodenk_spec.rb
  99. 2
      spec/models/form/lettings/questions/previous_la_known_spec.rb
  100. 4
      spec/models/form/lettings/questions/previous_let_type_spec.rb
  101. Some files were not shown because too many files have changed in this diff Show More

4
app/models/derived_variables/lettings_log_variables.rb

@ -65,7 +65,7 @@ module DerivedVariables::LettingsLogVariables
self.has_benefits = get_has_benefits self.has_benefits = get_has_benefits
self.tshortfall_known = 0 if tshortfall self.tshortfall_known = 0 if tshortfall
self.nocharge = household_charge&.zero? ? 1 : 0 self.nocharge = household_charge&.zero? ? 1 : 0
if form.start_year_after_2024? && is_bedsit? if form.start_year_2024_or_later? && is_bedsit?
self.beds = 1 self.beds = 1
end end
@ -186,7 +186,7 @@ private
self.wchair = nil self.wchair = nil
self.location_id = nil self.location_id = nil
end end
if form.start_year_after_2024? && (unittype_gn_changed? && unittype_gn_was == 2) if form.start_year_2024_or_later? && (unittype_gn_changed? && unittype_gn_was == 2)
self.beds = nil self.beds = nil
end end
end end

4
app/models/derived_variables/sales_log_variables.rb

@ -29,7 +29,7 @@ module DerivedVariables::SalesLogVariables
end end
end end
if saledate && form.start_year_after_2024? && discounted_ownership_sale? if saledate && form.start_year_2024_or_later? && discounted_ownership_sale?
self.ppostcode_full = postcode_full self.ppostcode_full = postcode_full
self.ppcodenk = pcodenk self.ppcodenk = pcodenk
self.prevloc = la self.prevloc = la
@ -44,7 +44,7 @@ module DerivedVariables::SalesLogVariables
self.hhmemb = number_of_household_members self.hhmemb = number_of_household_members
self.hhtype = household_type self.hhtype = household_type
if saledate && form.start_year_after_2024? if saledate && form.start_year_2024_or_later?
self.soctenant = soctenant_from_prevten_values self.soctenant = soctenant_from_prevten_values
child_under_16_constraints! child_under_16_constraints!
end end

9
app/models/form.rb

@ -334,7 +334,14 @@ class Form
type == "sales" || (start_year && start_year.to_i > 2022) type == "sales" || (start_year && start_year.to_i > 2022)
end end
def start_year_after_2024? def start_year_2024_or_later?
start_date && start_date.year >= 2024 start_date && start_date.year >= 2024
end end
def start_year_2025_or_later?
start_date && start_date.year >= 2025
end
def start_year_after_2024?
start_date && start_date.year > 2024
end
end end

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

@ -2,12 +2,12 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_nationality" @id = "lead_tenant_nationality"
@copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}" @copy_key = "lettings.household_characteristics.#{form.start_year_2024_or_later? ? 'nationality_all' : 'national'}"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end
def questions def questions
@questions ||= if form.start_year_after_2024? @questions ||= if form.start_year_2024_or_later?
[ [
Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self), Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self),
Form::Lettings::Questions::NationalityAll.new(nil, nil, self), Form::Lettings::Questions::NationalityAll.new(nil, nil, self),

4
app/models/form/lettings/pages/property_local_authority.rb

@ -3,8 +3,8 @@ class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page
super super
@id = "property_local_authority" @id = "property_local_authority"
@depends_on = [ @depends_on = [
{ "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => false }, { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => false },
{ "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => true, "address_search_given?" => true }, { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => true, "address_search_given?" => true },
] ]
end end

4
app/models/form/lettings/pages/uprn.rb

@ -14,7 +14,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
end end
def skip_text def skip_text
if form.start_year_after_2024? if form.start_year_2024_or_later?
"Search for address instead" "Search for address instead"
else else
"Enter address instead" "Enter address instead"
@ -24,7 +24,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
def skip_href(log = nil) def skip_href(log = nil)
return unless log return unless log
if form.start_year_after_2024? if form.start_year_2024_or_later?
"address-matcher" "address-matcher"
else else
"address" "address"

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

@ -27,7 +27,7 @@ class Form::Lettings::Questions::Age < ::Form::Question
end end
def hint_text def hint_text
if form.start_year_after_2024? if form.start_year_2024_or_later?
"Answer 1 for children aged under 1 year old" "Answer 1 for children aged under 1 year old"
end end
end end

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

@ -3,13 +3,13 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
super super
@id = "declaration" @id = "declaration"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024? @check_answers_card_number = 0 unless form.start_year_2024_or_later?
@top_guidance_partial = "privacy_notice_tenant" @top_guidance_partial = "privacy_notice_tenant"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
def answer_options def answer_options
declaration_text = if form.start_year_after_2024? declaration_text = if form.start_year_2024_or_later?
"The tenant has seen or been given access to the MHCLG privacy notice" "The tenant has seen or been given access to the MHCLG privacy notice"
else else
"The tenant has seen the MHCLG privacy notice" "The tenant has seen the MHCLG privacy notice"
@ -19,7 +19,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
end end
def unanswered_error_message def unanswered_error_message
if form.start_year_after_2024? if form.start_year_2024_or_later?
I18n.t("validations.declaration.missing.post_2024") I18n.t("validations.declaration.missing.post_2024")
else else
I18n.t("validations.declaration.missing.pre_2024") I18n.t("validations.declaration.missing.pre_2024")

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" },
"2" => { "value" => "Irish" }, "2" => { "value" => "Irish" },

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

@ -15,11 +15,11 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q
end end
def yes_hint def yes_hint
form.start_year_after_2024? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." form.start_year_2024_or_later? ? "This property was previously used for other purposes or is a new-build." : "This is a new let."
end end
def no_hint def no_hint
form.start_year_after_2024? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing."
end end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No" }, "0" => { "value" => "No" },

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

@ -10,7 +10,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No" }, "0" => { "value" => "No" },

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Just moved to local authority area with this new let" }, "1" => { "value" => "Just moved to local authority area with this new let" },
"2" => { "value" => "Less than 1 year" }, "2" => { "value" => "Less than 1 year" },

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." }, "cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." },
"cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." }, "cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." },

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

@ -10,7 +10,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"P" => { "value" => "Partner" }, "P" => { "value" => "Partner" },
"C" => { "value" => "Child" }, "C" => { "value" => "Child" },

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

@ -4,7 +4,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
@id = "unitletas" @id = "unitletas"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

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

@ -14,7 +14,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"50" => { "value" => "End of social or private sector tenancy - no fault" }, "50" => { "value" => "End of social or private sector tenancy - no fault" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },

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

@ -14,7 +14,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"50" => { "value" => "End of social or private sector tenancy - no fault" }, "50" => { "value" => "End of social or private sector tenancy - no fault" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

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

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

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

@ -5,7 +5,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
@copy_key = "lettings.setup.rent_type.rent_type" @copy_key = "lettings.setup.rent_type.rent_type"
@type = "radio" @type = "radio"
@top_guidance_partial = "rent_type_definitions" @top_guidance_partial = "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS
@conditional_for = { "irproduct_other" => [5] } @conditional_for = { "irproduct_other" => [5] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
end end

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"14" => { "14" => {
"value" => "Renewal of fixed-term tenancy", "value" => "Renewal of fixed-term tenancy",

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ "1" => { "value" => "Yes – specialist retirement housing" }, { "1" => { "value" => "Yes – specialist retirement housing" },
"2" => { "value" => "Yes – extra care housing" }, "2" => { "value" => "Yes – extra care housing" },
"5" => { "value" => "Yes – sheltered housing for adults aged under 55 years" }, "5" => { "value" => "Yes – sheltered housing for adults aged under 55 years" },

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

@ -10,7 +10,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"4" => { "4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term", "value" => "Assured Shorthold Tenancy (AST) – Fixed term",

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

@ -10,7 +10,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"4" => { "4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term", "value" => "Assured Shorthold Tenancy (AST) – Fixed term",

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::UprnConfirmation < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No, I want to search for the address instead" }, "0" => { "value" => "No, I want to search for the address instead" },

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

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"2" => { "value" => "Less than 1 year" }, "2" => { "value" => "Less than 1 year" },
"7" => { "value" => "1 year but under 2 years" }, "7" => { "value" => "1 year but under 2 years" },

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

@ -8,7 +8,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
def pages def pages
@pages ||= [ @pages ||= [
(Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_after_2024?), (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_2024_or_later?),
Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self), Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self),
Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self),
@ -33,8 +33,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("working_situation_lead_tenant_over_retirement_value_check", nil, self), Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("working_situation_lead_tenant_over_retirement_value_check", nil, self),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2), person_index: 2),
@ -42,7 +42,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 2), person_index: 2),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -53,8 +53,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_2_over_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_2_over_retirement_value_check", nil, self, person_index: 2),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3), person_index: 3),
@ -62,7 +62,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 3), person_index: 3),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -73,8 +73,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_3_over_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_3_over_retirement_value_check", nil, self, person_index: 3),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4), person_index: 4),
@ -82,7 +82,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 4), person_index: 4),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -93,8 +93,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_4_over_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_4_over_retirement_value_check", nil, self, person_index: 4),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5), person_index: 5),
@ -102,7 +102,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 5), person_index: 5),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -113,8 +113,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_5_over_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_5_over_retirement_value_check", nil, self, person_index: 5),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6), person_index: 6),
@ -122,7 +122,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 6), person_index: 6),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -133,8 +133,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_6_over_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_6_over_retirement_value_check", nil, self, person_index: 6),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7), person_index: 7),
@ -142,7 +142,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 7), person_index: 7),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
@ -153,8 +153,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_7_over_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_7_over_retirement_value_check", nil, self, person_index: 7),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8), person_index: 8),
@ -162,7 +162,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
person_index: 8), person_index: 8),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,

2
app/models/form/lettings/subsections/household_situation.rb

@ -12,7 +12,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection
Form::Lettings::Pages::TimeOnWaitingList.new(nil, nil, self), Form::Lettings::Pages::TimeOnWaitingList.new(nil, nil, self),
Form::Lettings::Pages::ReasonForLeavingLastSettledHome.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHome.new(nil, nil, self),
Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal.new(nil, nil, self),
(Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_after_2024?), (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_2024_or_later?),
Form::Lettings::Pages::PreviousHousingSituation.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituation.new(nil, nil, self),
Form::Lettings::Pages::PreviousHousingSituationRenewal.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituationRenewal.new(nil, nil, self),
Form::Lettings::Pages::Homelessness.new("homelessness", nil, self), Form::Lettings::Pages::Homelessness.new("homelessness", nil, self),

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

@ -29,7 +29,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
end end
def uprn_questions def uprn_questions
if form.start_year_after_2024? if form.start_year_2024_or_later?
[ [
Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::Uprn.new(nil, nil, self),
Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self),
@ -48,7 +48,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
end end
def number_of_times_relet def number_of_times_relet
Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_after_2024? Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_2024_or_later?
end end
def displayed_in_tasklist?(log) def displayed_in_tasklist?(log)

2
app/models/form/lettings/subsections/setup.rb

@ -20,7 +20,7 @@ class Form::Lettings::Subsections::Setup < ::Form::Subsection
Form::Lettings::Pages::RentType.new(nil, nil, self), Form::Lettings::Pages::RentType.new(nil, nil, self),
Form::Lettings::Pages::TenantCode.new(nil, nil, self), Form::Lettings::Pages::TenantCode.new(nil, nil, self),
Form::Lettings::Pages::PropertyReference.new(nil, nil, self), Form::Lettings::Pages::PropertyReference.new(nil, nil, self),
(Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_after_2024?), (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_2024_or_later?),
].compact ].compact
end end

2
app/models/form/lettings/subsections/tenancy_information.rb

@ -15,7 +15,7 @@ class Form::Lettings::Subsections::TenancyInformation < ::Form::Subsection
Form::Lettings::Pages::TenancyLength.new(nil, nil, self), Form::Lettings::Pages::TenancyLength.new(nil, nil, self),
Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self),
Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self),
(Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_after_2024?), (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_2024_or_later?),
Form::Lettings::Pages::ShelteredAccommodation.new(nil, nil, self), Form::Lettings::Pages::ShelteredAccommodation.new(nil, nil, self),
].flatten.compact ].flatten.compact
end end

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

@ -13,7 +13,7 @@ class Form::Sales::Pages::Buyer1Nationality < ::Form::Page
end end
def questions def questions
@questions ||= if form.start_year_after_2024? @questions ||= if form.start_year_2024_or_later?
[ [
Form::Sales::Questions::NationalityAllGroup.new("nationality_all_group", nil, self, 1), Form::Sales::Questions::NationalityAllGroup.new("nationality_all_group", nil, self, 1),
Form::Sales::Questions::NationalityAll.new("nationality_all", nil, self, 1), Form::Sales::Questions::NationalityAll.new("nationality_all", nil, self, 1),

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

@ -15,7 +15,7 @@ class Form::Sales::Pages::Buyer2Nationality < ::Form::Page
end end
def questions def questions
@questions ||= if form.start_year_after_2024? @questions ||= if form.start_year_2024_or_later?
[ [
Form::Sales::Questions::NationalityAllGroup.new("nationality_all_buyer2_group", nil, self, 2), Form::Sales::Questions::NationalityAllGroup.new("nationality_all_buyer2_group", nil, self, 2),
Form::Sales::Questions::NationalityAll.new("nationality_all_buyer2", nil, self, 2), Form::Sales::Questions::NationalityAll.new("nationality_all_buyer2", nil, self, 2),

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

@ -13,7 +13,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page
end end
def routed_to?(log, _current_user) def routed_to?(log, _current_user)
return false if log.is_staircase? && form.start_year_after_2024? return false if log.is_staircase? && form.start_year_2024_or_later?
super super
end end

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

@ -15,7 +15,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page
def routed_to?(log, _user) def routed_to?(log, _user)
return false unless super return false unless super
return true if log.ownershipsch == 2 || (log.ownershipsch == 3 && log.mortgageused == 1) return true if log.ownershipsch == 2 || (log.ownershipsch == 3 && log.mortgageused == 1)
return false if log.stairowned_100? != @optional && form.start_year_after_2024? return false if log.stairowned_100? != @optional && form.start_year_2024_or_later?
log.ownershipsch == 1 log.ownershipsch == 1
end end

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

@ -12,7 +12,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page
end end
def depends_on def depends_on
if form.start_year_after_2024? if form.start_year_2024_or_later?
[{ "social_homebuy?" => true, "stairowned_100?" => @optional }] [{ "social_homebuy?" => true, "stairowned_100?" => @optional }]
else else
[{ "social_homebuy?" => true }] [{ "social_homebuy?" => true }]

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

@ -12,7 +12,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page
end end
def routed_to?(log, _current_user) def routed_to?(log, _current_user)
return false if log.staircase == 1 && form.start_year_after_2024? return false if log.staircase == 1 && form.start_year_2024_or_later?
super super
end end

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

@ -13,7 +13,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page
end end
def routed_to?(log, _user) def routed_to?(log, _user)
return false if form.start_year_after_2024? && log.discounted_ownership_sale? return false if form.start_year_2024_or_later? && log.discounted_ownership_sale?
super super
end end

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

@ -16,7 +16,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page
end end
def routed_to?(log, _user) def routed_to?(log, _user)
return false if form.start_year_after_2024? && log.discounted_ownership_sale? return false if form.start_year_2024_or_later? && log.discounted_ownership_sale?
super super
end end

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

@ -13,7 +13,7 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page
def routed_to?(log, current_user) def routed_to?(log, current_user)
return false unless current_user return false unless current_user
if form.start_year_after_2024? if form.start_year_2024_or_later?
organisation = current_user.support? ? log.owning_organisation : current_user.organisation organisation = current_user.support? ? log.owning_organisation : current_user.organisation
return false unless organisation return false unless organisation

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

@ -3,8 +3,8 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
super super
@id = "property_local_authority" @id = "property_local_authority"
@depends_on = [ @depends_on = [
{ "is_la_inferred" => false, "form.start_year_after_2024?" => false }, { "is_la_inferred" => false, "form.start_year_2024_or_later?" => false },
{ "is_la_inferred" => false, "form.start_year_after_2024?" => true, "address_search_given?" => true }, { "is_la_inferred" => false, "form.start_year_2024_or_later?" => true, "address_search_given?" => true },
] ]
end end

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

@ -13,7 +13,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
end end
def skip_text def skip_text
if form.start_year_after_2024? if form.start_year_2024_or_later?
"Search for address instead" "Search for address instead"
else else
"Enter address instead" "Enter address instead"
@ -23,7 +23,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
def skip_href(log = nil) def skip_href(log = nil)
return unless log return unless log
if form.start_year_after_2024? if form.start_year_2024_or_later?
"address-matcher" "address-matcher"
else else
"address" "address"

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

@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" },
"2" => { "value" => "Irish" }, "2" => { "value" => "Irish" },

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

@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" },
"2" => { "value" => "Irish" }, "2" => { "value" => "Irish" },

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

@ -16,7 +16,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"P" => { "value" => "Partner" }, "P" => { "value" => "Partner" },

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

@ -22,7 +22,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
end end
def derived?(_log) def derived?(_log)
form.start_year_after_2024? form.start_year_2024_or_later?
end end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze

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

@ -5,7 +5,7 @@ class Form::Sales::Questions::Discount < ::Form::Question
@type = "numeric" @type = "numeric"
@copy_key = "sales.sale_information.discount" @copy_key = "sales.sale_information.discount"
@min = 0 @min = 0
@max = form.start_year_after_2024? ? 70 : 100 @max = form.start_year_2024_or_later? ? 70 : 100
@step = 0.1 @step = 0.1
@width = 5 @width = 5
@suffix = "%" @suffix = "%"

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

@ -60,7 +60,7 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
OPTIONS_NOT_DISPLAYED = %w[0].freeze OPTIONS_NOT_DISPLAYED = %w[0].freeze
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
ANSWER_OPTIONS ANSWER_OPTIONS
else else
ANSWER_OPTIONS.dup.reject { |k, _v| OPTIONS_INTRODUCED_2024.include?(k) } ANSWER_OPTIONS.dup.reject { |k, _v| OPTIONS_INTRODUCED_2024.include?(k) }

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

@ -11,7 +11,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
end end
def displayed_answer_options(log, _user = nil) def displayed_answer_options(log, _user = nil)
if log.outright_sale? && log.saledate && !form.start_year_after_2024? if log.outright_sale? && log.saledate && !form.start_year_2024_or_later?
answer_options_without_dont_know answer_options_without_dont_know
elsif log.stairowned == 100 || log.outright_sale? elsif log.stairowned == 100 || log.outright_sale?
ANSWER_OPTIONS ANSWER_OPTIONS

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

@ -7,7 +7,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes - a shared ownership scheme", "hint" => "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" }, "1" => { "value" => "Yes - a shared ownership scheme", "hint" => "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" },
"2" => { "value" => "Yes - a discounted ownership scheme" }, "2" => { "value" => "Yes - a discounted ownership scheme" },

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

@ -16,7 +16,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"P" => { "value" => "Partner" }, "P" => { "value" => "Partner" },
"C" => { "value" => "Child" }, "C" => { "value" => "Child" },

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

@ -10,7 +10,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
end end
def answer_options def answer_options
declaration_text = if form.start_year_after_2024? declaration_text = if form.start_year_2024_or_later?
"The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen or been given access to the MHCLG privacy notice" "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen or been given access to the MHCLG privacy notice"
else else
"The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen the MHCLG privacy notice" "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen the MHCLG privacy notice"
@ -21,7 +21,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
def unanswered_error_message def unanswered_error_message
buyer_or_buyers = @joint_purchase ? "buyers" : "buyer" buyer_or_buyers = @joint_purchase ? "buyers" : "buyer"
if form.start_year_after_2024? if form.start_year_2024_or_later?
I18n.t("validations.privacynotice.missing.post_2024", buyer_or_buyers:) I18n.t("validations.privacynotice.missing.post_2024", buyer_or_buyers:)
else else
I18n.t("validations.privacynotice.missing.pre_2024", buyer_or_buyers:) I18n.t("validations.privacynotice.missing.pre_2024", buyer_or_buyers:)

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

@ -6,7 +6,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No, I want to search for the address instead" }, "0" => { "value" => "No, I want to search for the address instead" },

66
app/models/form/sales/subsections/household_characteristics.rb

@ -8,13 +8,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection
def pages def pages
@pages ||= [ @pages ||= [
(Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?),
(Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_after_2024?), (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?),
(Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?),
(Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_after_2024?), (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?),
Form::Sales::Pages::Age1.new(nil, nil, self), Form::Sales::Pages::Age1.new(nil, nil, self),
Form::Sales::Pages::RetirementValueCheck.new("age_1_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::RetirementValueCheck.new("age_1_retirement_value_check", nil, self, person_index: 1),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?),
Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true),
Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false),
Form::Sales::Pages::GenderIdentity1.new(nil, nil, self), Form::Sales::Pages::GenderIdentity1.new(nil, nil, self),
@ -27,7 +27,7 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Sales::Pages::Buyer1Nationality.new(nil, nil, self), Form::Sales::Pages::Buyer1Nationality.new(nil, nil, self),
Form::Sales::Pages::Buyer1WorkingSituation.new(nil, nil, self), Form::Sales::Pages::Buyer1WorkingSituation.new(nil, nil, self),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_1_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::RetirementValueCheck.new("working_situation_1_retirement_value_check", nil, self, person_index: 1),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?),
Form::Sales::Pages::Buyer1IncomeMinValueCheck.new("working_situation_buyer_1_income_min_value_check", nil, self), Form::Sales::Pages::Buyer1IncomeMinValueCheck.new("working_situation_buyer_1_income_min_value_check", nil, self),
Form::Sales::Pages::Buyer1LiveInProperty.new(nil, nil, self), Form::Sales::Pages::Buyer1LiveInProperty.new(nil, nil, self),
Form::Sales::Pages::BuyerLiveInValueCheck.new("buyer_1_live_in_property_value_check", nil, self, person_index: 1), Form::Sales::Pages::BuyerLiveInValueCheck.new("buyer_1_live_in_property_value_check", nil, self, person_index: 1),
@ -37,13 +37,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true),
Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false),
Form::Sales::Pages::RetirementValueCheck.new("age_2_buyer_retirement_value_check", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("age_2_buyer_retirement_value_check", nil, self, person_index: 2),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_age_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_age_student_not_child_value_check", nil, self, person_index: 2),
Form::Sales::Pages::GenderIdentity2.new(nil, nil, self), Form::Sales::Pages::GenderIdentity2.new(nil, nil, self),
buyer_2_ethnicity_nationality_pages, buyer_2_ethnicity_nationality_pages,
Form::Sales::Pages::Buyer2WorkingSituation.new(nil, nil, self), Form::Sales::Pages::Buyer2WorkingSituation.new(nil, nil, self),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check_joint_purchase", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check_joint_purchase", nil, self, person_index: 2),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::Buyer2IncomeMinValueCheck.new("working_situation_buyer_2_income_min_value_check", nil, self), Form::Sales::Pages::Buyer2IncomeMinValueCheck.new("working_situation_buyer_2_income_min_value_check", nil, self),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_working_situation_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_working_situation_student_not_child_value_check", nil, self, person_index: 2),
Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self), Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self),
@ -52,78 +52,78 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Sales::Pages::NumberOfOthersInProperty.new("number_of_others_in_property_joint_purchase", nil, self, joint_purchase: true), Form::Sales::Pages::NumberOfOthersInProperty.new("number_of_others_in_property_joint_purchase", nil, self, joint_purchase: true),
Form::Sales::Pages::PersonKnown.new("person_2_known", nil, self, person_index: 2), Form::Sales::Pages::PersonKnown.new("person_2_known", nil, self, person_index: 2),
Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1", nil, self, person_index: 2), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1", nil, self, person_index: 2),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
(Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_2_student_not_child_value_check", nil, self, person_index: 2),
Form::Sales::Pages::PersonAge.new("person_2_age", nil, self, person_index: 2), Form::Sales::Pages::PersonAge.new("person_2_age", nil, self, person_index: 2),
Form::Sales::Pages::RetirementValueCheck.new("age_2_retirement_value_check", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("age_2_retirement_value_check", nil, self, person_index: 2),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_2_student_not_child_value_check", nil, self, person_index: 2),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity", nil, self, person_index: 2), Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity", nil, self, person_index: 2),
Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation", nil, self, person_index: 2), Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation", nil, self, person_index: 2),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check", nil, self, person_index: 2),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_2_student_not_child_value_check", nil, self, person_index: 2),
Form::Sales::Pages::PersonKnown.new("person_3_known", nil, self, person_index: 3), Form::Sales::Pages::PersonKnown.new("person_3_known", nil, self, person_index: 3),
Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1", nil, self, person_index: 3), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1", nil, self, person_index: 3),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
(Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_3_student_not_child_value_check", nil, self, person_index: 3),
Form::Sales::Pages::PersonAge.new("person_3_age", nil, self, person_index: 3), Form::Sales::Pages::PersonAge.new("person_3_age", nil, self, person_index: 3),
Form::Sales::Pages::RetirementValueCheck.new("age_3_retirement_value_check", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("age_3_retirement_value_check", nil, self, person_index: 3),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_3_student_not_child_value_check", nil, self, person_index: 3),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity", nil, self, person_index: 3), Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity", nil, self, person_index: 3),
Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation", nil, self, person_index: 3), Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation", nil, self, person_index: 3),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_3_retirement_value_check", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("working_situation_3_retirement_value_check", nil, self, person_index: 3),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_3_student_not_child_value_check", nil, self, person_index: 3),
Form::Sales::Pages::PersonKnown.new("person_4_known", nil, self, person_index: 4), Form::Sales::Pages::PersonKnown.new("person_4_known", nil, self, person_index: 4),
Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1", nil, self, person_index: 4), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1", nil, self, person_index: 4),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
(Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_4_student_not_child_value_check", nil, self, person_index: 4),
Form::Sales::Pages::PersonAge.new("person_4_age", nil, self, person_index: 4), Form::Sales::Pages::PersonAge.new("person_4_age", nil, self, person_index: 4),
Form::Sales::Pages::RetirementValueCheck.new("age_4_retirement_value_check", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("age_4_retirement_value_check", nil, self, person_index: 4),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_4_student_not_child_value_check", nil, self, person_index: 4),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity", nil, self, person_index: 4), Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity", nil, self, person_index: 4),
Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation", nil, self, person_index: 4), Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation", nil, self, person_index: 4),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_4_retirement_value_check", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("working_situation_4_retirement_value_check", nil, self, person_index: 4),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_4_student_not_child_value_check", nil, self, person_index: 4),
Form::Sales::Pages::PersonKnown.new("person_5_known", nil, self, person_index: 5), Form::Sales::Pages::PersonKnown.new("person_5_known", nil, self, person_index: 5),
Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_5_relationship_to_buyer_1", nil, self, person_index: 5), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_5_relationship_to_buyer_1", nil, self, person_index: 5),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
(Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_5_student_not_child_value_check", nil, self, person_index: 5),
Form::Sales::Pages::PersonAge.new("person_5_age", nil, self, person_index: 5), Form::Sales::Pages::PersonAge.new("person_5_age", nil, self, person_index: 5),
Form::Sales::Pages::RetirementValueCheck.new("age_5_retirement_value_check", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("age_5_retirement_value_check", nil, self, person_index: 5),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_5_student_not_child_value_check", nil, self, person_index: 5),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonGenderIdentity.new("person_5_gender_identity", nil, self, person_index: 5), Form::Sales::Pages::PersonGenderIdentity.new("person_5_gender_identity", nil, self, person_index: 5),
Form::Sales::Pages::PersonWorkingSituation.new("person_5_working_situation", nil, self, person_index: 5), Form::Sales::Pages::PersonWorkingSituation.new("person_5_working_situation", nil, self, person_index: 5),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_5_retirement_value_check", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("working_situation_5_retirement_value_check", nil, self, person_index: 5),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_5_student_not_child_value_check", nil, self, person_index: 5),
Form::Sales::Pages::PersonKnown.new("person_6_known", nil, self, person_index: 6), Form::Sales::Pages::PersonKnown.new("person_6_known", nil, self, person_index: 6),
Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_6_relationship_to_buyer_1", nil, self, person_index: 6), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_6_relationship_to_buyer_1", nil, self, person_index: 6),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
(Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_6_student_not_child_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_6_student_not_child_value_check", nil, self, person_index: 6),
Form::Sales::Pages::PersonAge.new("person_6_age", nil, self, person_index: 6), Form::Sales::Pages::PersonAge.new("person_6_age", nil, self, person_index: 6),
Form::Sales::Pages::RetirementValueCheck.new("age_6_retirement_value_check", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("age_6_retirement_value_check", nil, self, person_index: 6),
(Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_6_student_not_child_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_6_student_not_child_value_check", nil, self, person_index: 6),
(Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonGenderIdentity.new("person_6_gender_identity", nil, self, person_index: 6), Form::Sales::Pages::PersonGenderIdentity.new("person_6_gender_identity", nil, self, person_index: 6),
Form::Sales::Pages::PersonWorkingSituation.new("person_6_working_situation", nil, self, person_index: 6), Form::Sales::Pages::PersonWorkingSituation.new("person_6_working_situation", nil, self, person_index: 6),
Form::Sales::Pages::RetirementValueCheck.new("working_situation_6_retirement_value_check", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("working_situation_6_retirement_value_check", nil, self, person_index: 6),
(Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_6_student_not_child_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_6_student_not_child_value_check", nil, self, person_index: 6),
].flatten.compact ].flatten.compact
end end

4
app/models/form/sales/subsections/outright_sale.rb

@ -14,8 +14,8 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection
Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self),
Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, ownershipsch: 3),
Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self),
(Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), (Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?),
(Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), (Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?),
Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, ownershipsch: 3),
Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, ownershipsch: 3),
Form::Sales::Pages::Deposit.new("deposit_outright_sale", nil, self, ownershipsch: 3, optional: false), Form::Sales::Pages::Deposit.new("deposit_outright_sale", nil, self, ownershipsch: 3, optional: false),

2
app/models/form/sales/subsections/property_information.rb

@ -21,7 +21,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
end end
def uprn_questions def uprn_questions
if form.start_year_after_2024? if form.start_year_2024_or_later?
[ [
Form::Sales::Pages::Uprn.new(nil, nil, self), Form::Sales::Pages::Uprn.new(nil, nil, self),
Form::Sales::Pages::UprnConfirmation.new(nil, nil, self), Form::Sales::Pages::UprnConfirmation.new(nil, nil, self),

8
app/models/form/sales/subsections/setup.rb

@ -20,10 +20,10 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection
Form::Sales::Pages::BuyerLive.new(nil, nil, self), Form::Sales::Pages::BuyerLive.new(nil, nil, self),
Form::Sales::Pages::JointPurchase.new(nil, nil, self), Form::Sales::Pages::JointPurchase.new(nil, nil, self),
Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self), Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self),
(Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?),
(Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_after_2024?), (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_2024_or_later?),
(Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?),
(Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_after_2024?), (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_2024_or_later?),
].flatten.compact ].flatten.compact
end end
end end

4
app/models/form/sales/subsections/shared_ownership_scheme.rb

@ -40,11 +40,11 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection
Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1),
Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1),
Form::Sales::Pages::Deposit.new("deposit_shared_ownership", nil, self, ownershipsch: 1, optional: false), Form::Sales::Pages::Deposit.new("deposit_shared_ownership", nil, self, ownershipsch: 1, optional: false),
(Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_after_2024?), (Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_2024_or_later?),
Form::Sales::Pages::DepositValueCheck.new("deposit_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::DepositValueCheck.new("deposit_joint_purchase_value_check", nil, self, joint_purchase: true),
Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self, joint_purchase: false),
Form::Sales::Pages::DepositDiscount.new("deposit_discount", nil, self, optional: false), Form::Sales::Pages::DepositDiscount.new("deposit_discount", nil, self, optional: false),
(Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_after_2024?), (Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_2024_or_later?),
Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self),
Form::Sales::Pages::MonthlyRent.new(nil, nil, self), Form::Sales::Pages::MonthlyRent.new(nil, nil, self),
Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1),

4
app/models/lettings_log.rb

@ -391,7 +391,7 @@ class LettingsLog < Log
end end
def is_beds_inferred? def is_beds_inferred?
form.start_year_after_2024? && is_bedsit? form.start_year_2024_or_later? && is_bedsit?
end end
def is_shared_housing? def is_shared_housing?
@ -899,7 +899,7 @@ private
def should_process_address_change? def should_process_address_change?
return unless uprn_selection || select_best_address_match return unless uprn_selection || select_best_address_match
return unless startdate return unless startdate
return unless form.start_year_after_2024? return unless form.start_year_2024_or_later?
if select_best_address_match if select_best_address_match
address_line1_input.present? && postcode_full_input.present? address_line1_input.present? && postcode_full_input.present?

6
app/models/sales_log.rb

@ -131,7 +131,7 @@ class SalesLog < Log
not_required << "proplen" if proplen_optional? not_required << "proplen" if proplen_optional?
not_required << "mortlen" if mortlen_optional? not_required << "mortlen" if mortlen_optional?
not_required << "frombeds" if frombeds_optional? not_required << "frombeds" if frombeds_optional?
not_required << "deposit" if form.start_year_after_2024? && stairowned_100? not_required << "deposit" if form.start_year_2024_or_later? && stairowned_100?
not_required |= %w[address_line2 county postcode_full] if saledate && collection_start_year_for_date(saledate) >= 2023 not_required |= %w[address_line2 county postcode_full] if saledate && collection_start_year_for_date(saledate) >= 2023
@ -453,7 +453,7 @@ class SalesLog < Log
def should_process_address_change? def should_process_address_change?
return unless uprn_selection || select_best_address_match return unless uprn_selection || select_best_address_match
return unless saledate return unless saledate
return unless form.start_year_after_2024? return unless form.start_year_2024_or_later?
if select_best_address_match if select_best_address_match
address_line1_input.present? && postcode_full_input.present? address_line1_input.present? && postcode_full_input.present?
@ -515,7 +515,7 @@ class SalesLog < Log
end end
def soctenant_is_inferred? def soctenant_is_inferred?
form.start_year_after_2024? form.start_year_2024_or_later?
end end
def duplicates def duplicates

10
app/models/validations/household_validations.rb

@ -35,7 +35,7 @@ module Validations::HouseholdValidations
record.errors.add :reason, I18n.t("validations.household.reason.not_internal_transfer") record.errors.add :reason, I18n.t("validations.household.reason.not_internal_transfer")
end end
return unless record.form.start_year_after_2024? return unless record.form.start_year_2024_or_later?
if record.reason == 20 && PHRASES_INDICATING_HOMELESSNESS_REGEX.match?(record.reasonother) if record.reason == 20 && PHRASES_INDICATING_HOMELESSNESS_REGEX.match?(record.reasonother)
record.errors.add :reason, I18n.t("validations.household.reason.other_not_settled") record.errors.add :reason, I18n.t("validations.household.reason.other_not_settled")
@ -56,7 +56,7 @@ module Validations::HouseholdValidations
end end
def validate_person_1_economic(record) def validate_person_1_economic(record)
return unless record.age1 && record.ecstat1 && !record.form.start_year_after_2024? return unless record.age1 && record.ecstat1 && !record.form.start_year_2024_or_later?
if record.age1 < 16 && !economic_status_is_child_other_or_refused?(record.ecstat1) if record.age1 < 16 && !economic_status_is_child_other_or_refused?(record.ecstat1)
record.errors.add "ecstat1", I18n.t("validations.household.ecstat.child_under_16", person_num: 1) record.errors.add "ecstat1", I18n.t("validations.household.ecstat.child_under_16", person_num: 1)
@ -74,7 +74,7 @@ module Validations::HouseholdValidations
economic_status = record.public_send("ecstat#{person_num}") economic_status = record.public_send("ecstat#{person_num}")
next unless age && economic_status next unless age && economic_status
if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later?
record.errors.add "ecstat#{person_num}", I18n.t("validations.household.ecstat.child_under_16", person_num:) record.errors.add "ecstat#{person_num}", I18n.t("validations.household.ecstat.child_under_16", person_num:)
record.errors.add "age#{person_num}", I18n.t("validations.household.age.child_under_16_ecstat", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.household.age.child_under_16_ecstat", person_num:)
end end
@ -86,7 +86,7 @@ module Validations::HouseholdValidations
end end
def validate_person_age_matches_relationship(record) def validate_person_age_matches_relationship(record)
return unless record.startdate && !record.form.start_year_after_2024? return unless record.startdate && !record.form.start_year_2024_or_later?
(2..8).each do |person_num| (2..8).each do |person_num|
age = record.public_send("age#{person_num}") age = record.public_send("age#{person_num}")
@ -101,7 +101,7 @@ module Validations::HouseholdValidations
end end
def validate_person_age_and_relationship_matches_economic_status(record) def validate_person_age_and_relationship_matches_economic_status(record)
return unless record.startdate && !record.form.start_year_after_2024? return unless record.startdate && !record.form.start_year_2024_or_later?
(2..8).each do |person_num| (2..8).each do |person_num|
age = record.public_send("age#{person_num}") age = record.public_send("age#{person_num}")

2
app/models/validations/property_validations.rb

@ -35,7 +35,7 @@ module Validations::PropertyValidations
def validate_shared_housing_rooms(record) def validate_shared_housing_rooms(record)
return unless record.unittype_gn return unless record.unittype_gn
if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_after_2024? if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_2024_or_later?
record.errors.add :unittype_gn, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") record.errors.add :unittype_gn, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit")
record.errors.add :beds, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") record.errors.add :beds, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit")
end end

4
app/models/validations/sales/financial_validations.rb

@ -54,7 +54,7 @@ module Validations::Sales::FinancialValidations
def validate_percentage_bought_not_equal_percentage_owned(record) def validate_percentage_bought_not_equal_percentage_owned(record)
return unless record.stairbought && record.stairowned return unless record.stairbought && record.stairowned
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
if record.stairbought == record.stairowned if record.stairbought == record.stairowned
record.errors.add :stairbought, I18n.t("validations.financial.staircasing.percentage_bought_equal_percentage_owned", stairbought: sprintf("%g", record.stairbought), stairowned: sprintf("%g", record.stairowned)) record.errors.add :stairbought, I18n.t("validations.financial.staircasing.percentage_bought_equal_percentage_owned", stairbought: sprintf("%g", record.stairbought), stairowned: sprintf("%g", record.stairowned))
@ -105,7 +105,7 @@ module Validations::Sales::FinancialValidations
def validate_equity_less_than_staircase_difference(record) def validate_equity_less_than_staircase_difference(record)
return unless record.equity && record.stairbought && record.stairowned return unless record.equity && record.stairbought && record.stairowned
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
if record.equity > record.stairowned - record.stairbought if record.equity > record.stairowned - record.stairbought
formatted_equity = sprintf("%g", record.equity) formatted_equity = sprintf("%g", record.equity)

12
app/models/validations/sales/household_validations.rb

@ -16,7 +16,7 @@ module Validations::Sales::HouseholdValidations
end end
def validate_buyer1_previous_tenure(record) def validate_buyer1_previous_tenure(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.discounted_ownership_sale? && record.prevten return unless record.discounted_ownership_sale? && record.prevten
if [3, 4, 5, 6, 7, 9, 0].include?(record.prevten) if [3, 4, 5, 6, 7, 9, 0].include?(record.prevten)
@ -26,7 +26,7 @@ module Validations::Sales::HouseholdValidations
end end
def validate_person_age_matches_relationship(record) def validate_person_age_matches_relationship(record)
return unless record.saledate && !record.form.start_year_after_2024? return unless record.saledate && !record.form.start_year_2024_or_later?
(2..6).each do |person_num| (2..6).each do |person_num|
age = record.public_send("age#{person_num}") age = record.public_send("age#{person_num}")
@ -44,7 +44,7 @@ module Validations::Sales::HouseholdValidations
end end
def validate_person_age_and_relationship_matches_economic_status(record) def validate_person_age_and_relationship_matches_economic_status(record)
return unless record.saledate && !record.form.start_year_after_2024? return unless record.saledate && !record.form.start_year_2024_or_later?
(2..6).each do |person_num| (2..6).each do |person_num|
age = record.public_send("age#{person_num}") age = record.public_send("age#{person_num}")
@ -77,7 +77,7 @@ module Validations::Sales::HouseholdValidations
economic_status = record.public_send("ecstat#{person_num}") economic_status = record.public_send("ecstat#{person_num}")
next unless age && economic_status next unless age && economic_status
if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later?
record.errors.add "ecstat#{person_num}", I18n.t("validations.sales.household.ecstat.child_under_16", person_num:) record.errors.add "ecstat#{person_num}", I18n.t("validations.sales.household.ecstat.child_under_16", person_num:)
record.errors.add "age#{person_num}", I18n.t("validations.sales.household.age.child_under_16_ecstat", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.sales.household.age.child_under_16_ecstat", person_num:)
end end
@ -89,7 +89,7 @@ module Validations::Sales::HouseholdValidations
end end
def validate_child_12_years_younger(record) def validate_child_12_years_younger(record)
return unless record.saledate && !record.form.start_year_after_2024? return unless record.saledate && !record.form.start_year_2024_or_later?
(2..6).each do |person_num| (2..6).each do |person_num|
buyer_1_age = record.public_send("age1") buyer_1_age = record.public_send("age1")
@ -106,7 +106,7 @@ module Validations::Sales::HouseholdValidations
end end
def validate_buyer_not_child(record) def validate_buyer_not_child(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
record.errors.add "ecstat1", I18n.t("validations.sales.household.ecstat1.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat1) record.errors.add "ecstat1", I18n.t("validations.sales.household.ecstat1.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat1)
record.errors.add "ecstat2", I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat2) && record.joint_purchase? record.errors.add "ecstat2", I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat2) && record.joint_purchase?

2
app/models/validations/sales/property_validations.rb

@ -1,6 +1,6 @@
module Validations::Sales::PropertyValidations module Validations::Sales::PropertyValidations
def validate_postcodes_match_if_discounted_ownership(record) def validate_postcodes_match_if_discounted_ownership(record)
return unless record.saledate && !record.form.start_year_after_2024? return unless record.saledate && !record.form.start_year_2024_or_later?
return unless record.ppostcode_full.present? && record.postcode_full.present? return unless record.ppostcode_full.present? && record.postcode_full.present?
if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full

18
app/models/validations/sales/sale_information_validations.rb

@ -12,7 +12,7 @@ module Validations::Sales::SaleInformationValidations
record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_after_hodate") record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_after_hodate")
end end
if record.saledate - record.hodate >= 3.years && record.form.start_year_after_2024? if record.saledate - record.hodate >= 3.years && record.form.start_year_2024_or_later?
record.errors.add :hodate, I18n.t("validations.sales.sale_information.hodate.must_be_less_than_3_years_from_saledate") record.errors.add :hodate, I18n.t("validations.sales.sale_information.hodate.must_be_less_than_3_years_from_saledate")
record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_3_years_from_hodate") record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_3_years_from_hodate")
end end
@ -42,7 +42,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_discounted_ownership_value(record) def validate_discounted_ownership_value(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.value && record.deposit && record.ownershipsch return unless record.value && record.deposit && record.ownershipsch
return unless record.mortgage || record.mortgageused == 2 || record.mortgageused == 3 return unless record.mortgage || record.mortgageused == 2 || record.mortgageused == 3
return unless record.discount || record.grant || record.type == 29 return unless record.discount || record.grant || record.type == 29
@ -65,7 +65,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_outright_sale_value_matches_mortgage_plus_deposit(record) def validate_outright_sale_value_matches_mortgage_plus_deposit(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.outright_sale? return unless record.outright_sale?
return unless record.mortgage_used? && record.mortgage return unless record.mortgage_used? && record.mortgage
return unless record.deposit && record.value return unless record.deposit && record.value
@ -96,7 +96,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_grant_amount(record) def validate_grant_amount(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.grant && (record.type == 8 || record.type == 21) return unless record.grant && (record.type == 8 || record.type == 21)
unless record.grant.between?(9_000, 16_000) unless record.grant.between?(9_000, 16_000)
@ -106,7 +106,7 @@ module Validations::Sales::SaleInformationValidations
def validate_stairbought(record) def validate_stairbought(record)
return unless record.stairbought && record.type return unless record.stairbought && record.type
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
max_stairbought = case record.type max_stairbought = case record.type
when 30, 16, 28, 31, 32 when 30, 16, 28, 31, 32
@ -124,7 +124,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_discount_and_value(record) def validate_discount_and_value(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.discount && record.value && record.la return unless record.discount && record.value && record.la
if record.london_property? && record.discount_value > 136_400 if record.london_property? && record.discount_value > 136_400
@ -139,7 +139,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_non_staircasing_mortgage(record) def validate_non_staircasing_mortgage(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.value && record.deposit && record.equity return unless record.value && record.deposit && record.equity
return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_not_staircasing? return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_not_staircasing?
@ -151,7 +151,7 @@ module Validations::Sales::SaleInformationValidations
end end
def validate_staircasing_mortgage(record) def validate_staircasing_mortgage(record)
return unless record.saledate && record.form.start_year_after_2024? return unless record.saledate && record.form.start_year_2024_or_later?
return unless record.value && record.deposit && record.stairbought return unless record.value && record.deposit && record.stairbought
return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_staircase? return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_staircase?
@ -334,7 +334,7 @@ module Validations::Sales::SaleInformationValidations
if record.discounted_ownership_sale? if record.discounted_ownership_sale?
record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?")
end end
if record.outright_sale? && record.saledate && !record.form.start_year_after_2024? if record.outright_sale? && record.saledate && !record.form.start_year_2024_or_later?
record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?")
record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.mortgage_used_year") record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.mortgage_used_year")
end end

4
app/models/validations/sales/soft_validations.rb

@ -68,7 +68,7 @@ module Validations::Sales::SoftValidations
end end
def extra_borrowing_expected_but_not_reported? def extra_borrowing_expected_but_not_reported?
return unless saledate && !form.start_year_after_2024? return unless saledate && !form.start_year_2024_or_later?
return unless extrabor && mortgage && deposit && value && discount return unless extrabor && mortgage && deposit && value && discount
extrabor != 1 && mortgage + deposit > value - value * discount / 100 extrabor != 1 && mortgage + deposit > value - value * discount / 100
@ -118,7 +118,7 @@ module Validations::Sales::SoftValidations
def grant_outside_common_range? def grant_outside_common_range?
return unless grant && type && saledate return unless grant && type && saledate
return if form.start_year_after_2024? && (type == 21 || type == 8) return if form.start_year_2024_or_later? && (type == 21 || type == 8)
!grant.between?(9_000, 16_000) !grant.between?(9_000, 16_000)
end end

2
app/models/validations/shared_validations.rb

@ -126,7 +126,7 @@ module Validations::SharedValidations
end end
def shared_validate_partner_count(record, max_people) def shared_validate_partner_count(record, max_people)
return if record.form.start_year_after_2024? return if record.form.start_year_2024_or_later?
partner_numbers = (2..max_people).select { |n| person_is_partner?(record["relat#{n}"]) } partner_numbers = (2..max_people).select { |n| person_is_partner?(record["relat#{n}"]) }
if partner_numbers.count > 1 if partner_numbers.count > 1

4
app/services/exports/lettings_log_export_service.rb

@ -146,8 +146,8 @@ module Exports
field_name.starts_with?(details_known_prefix) || field_name.starts_with?(details_known_prefix) ||
pattern_age.match(field_name) || pattern_age.match(field_name) ||
!EXPORT_FIELDS.include?(field_name) || !EXPORT_FIELDS.include?(field_name) ||
(lettings_log.form.start_year_after_2024? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || (lettings_log.form.start_year_2024_or_later? && PRE_2024_EXPORT_FIELDS.include?(field_name)) ||
(!lettings_log.form.start_year_after_2024? && POST_2024_EXPORT_FIELDS.include?(field_name)) (!lettings_log.form.start_year_2024_or_later? && POST_2024_EXPORT_FIELDS.include?(field_name))
end end
def build_export_xml(lettings_logs) def build_export_xml(lettings_logs)

2
spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing, type:
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

2
spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite, type: :mo
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

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

@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do
subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) }
let(:person_index) { 2 } let(:person_index) { 2 }
it "has correct subsection" do it "has correct subsection" do

2
spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb

@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do
subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) }
let(:person_index) { 2 } let(:person_index) { 2 }
it "has correct subsection" do it "has correct subsection" do

2
spec/models/form/lettings/pages/previous_local_authority_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousLocalAuthority, type: :model do
let(:page_id) { nil } let(:page_id) { nil }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

2
spec/models/form/lettings/pages/previous_postcode_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousPostcode, type: :model do
let(:page_id) { "previous_postcode" } let(:page_id) { "previous_postcode" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)

4
spec/models/form/lettings/pages/property_local_authority_spec.rb

@ -37,7 +37,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do
context "with form before 2024" do context "with form before 2024" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
end end
it "is routed to when la is not inferred and it is general needs log" do it "is routed to when la is not inferred and it is general needs log" do
@ -61,7 +61,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do
context "with form after 2024" do context "with form after 2024" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "is routed to when la is not inferred, it is general needs log and address search has been given" do it "is routed to when la is not inferred, it is general needs log and address search has been given" do

2
spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb

@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) }
before do before do
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1)))
end end
it "has correct subsection" do it "has correct subsection" do

2
spec/models/form/lettings/pages/renewal_spec.rb

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Renewal, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

2
spec/models/form/lettings/pages/rent_type_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do
before do before do
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has correct subsection" do it "has correct subsection" do

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

@ -7,7 +7,7 @@ RSpec.describe Form::Lettings::Pages::StarterTenancyType, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

4
spec/models/form/lettings/pages/uprn_spec.rb

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "points to address search page" do it "points to address search page" do

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

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

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

@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, person_index:) } subject(:question) { described_class.new(nil, question_definition, page, person_index:) }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) }
let(:person_index) { 2 } let(:person_index) { 2 }
it "has correct page" do it "has correct page" do

6
spec/models/form/lettings/questions/declaration_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?) allow(form).to receive(:start_year_2024_or_later?)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do
context "when the form year is before 2024" do context "when the form year is before 2024" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
end end
it "has the correct answer_options" do it "has the correct answer_options" do
@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do
context "when the form year is >= 2024" do context "when the form year is >= 2024" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

4
spec/models/form/lettings/questions/ethnic_white_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

4
spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -34,7 +34,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

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

@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) }
before do before do
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)

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

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

4
spec/models/form/lettings/questions/housingneeds_other_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

4
spec/models/form/lettings/questions/is_carehome_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options in the correct order" do it "has the correct answer_options in the correct order" do

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

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

4
spec/models/form/lettings/questions/layear_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -49,7 +49,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

4
spec/models/form/lettings/questions/letting_allocation_spec.rb

@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -45,7 +45,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do
context "with 2024/25 form" do context "with 2024/25 form" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer_options" do it "has the correct answer_options" do

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

@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do
subject(:question) { described_class.new(nil, question_definition, page, person_index:) } subject(:question) { described_class.new(nil, question_definition, page, person_index:) }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) }
let(:person_index) { 2 } let(:person_index) { 2 }
it "has correct page" do it "has correct page" do

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

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

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

@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end

4
spec/models/form/lettings/questions/previous_let_type_spec.rb

@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(page).to receive(:subsection).and_return(subsection) allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
end end
@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do
context "with collection year on or after 2024" do context "with collection year on or after 2024" do
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has the correct answer options" do it "has the correct answer options" do

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

Loading…
Cancel
Save