diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb
index 8af78b169..2e88034d7 100644
--- a/app/components/create_log_actions_component.html.erb
+++ b/app/components/create_log_actions_component.html.erb
@@ -1,6 +1,6 @@
<% if display_actions? %>
- <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-6" %>
+ <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %>
<% unless user.support? %>
<%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %>
<% end %>
diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb
index e50161188..9219392f7 100644
--- a/app/models/derived_variables/lettings_log_variables.rb
+++ b/app/models/derived_variables/lettings_log_variables.rb
@@ -65,7 +65,7 @@ module DerivedVariables::LettingsLogVariables
self.has_benefits = get_has_benefits
self.tshortfall_known = 0 if tshortfall
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
end
@@ -186,7 +186,7 @@ private
self.wchair = nil
self.location_id = nil
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
end
end
diff --git a/app/models/derived_variables/sales_log_variables.rb b/app/models/derived_variables/sales_log_variables.rb
index f23f9eb28..e182c2158 100644
--- a/app/models/derived_variables/sales_log_variables.rb
+++ b/app/models/derived_variables/sales_log_variables.rb
@@ -29,7 +29,7 @@ module DerivedVariables::SalesLogVariables
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.ppcodenk = pcodenk
self.prevloc = la
@@ -44,7 +44,7 @@ module DerivedVariables::SalesLogVariables
self.hhmemb = number_of_household_members
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
child_under_16_constraints!
end
diff --git a/app/models/form.rb b/app/models/form.rb
index 4336376e6..ce77378ca 100644
--- a/app/models/form.rb
+++ b/app/models/form.rb
@@ -334,7 +334,11 @@ class Form
type == "sales" || (start_year && start_year.to_i > 2022)
end
- def start_year_after_2024?
+ def start_year_2024_or_later?
start_date && start_date.year >= 2024
end
+
+ def start_year_2025_or_later?
+ start_date && start_date.year >= 2025
+ end
end
diff --git a/app/models/form/lettings/pages/lead_tenant_nationality.rb b/app/models/form/lettings/pages/lead_tenant_nationality.rb
index d4845f8f9..410a6320f 100644
--- a/app/models/form/lettings/pages/lead_tenant_nationality.rb
+++ b/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)
super
@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 }]
end
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::NationalityAll.new(nil, nil, self),
diff --git a/app/models/form/lettings/pages/property_local_authority.rb b/app/models/form/lettings/pages/property_local_authority.rb
index 1e3d34bd2..339ccb4d8 100644
--- a/app/models/form/lettings/pages/property_local_authority.rb
+++ b/app/models/form/lettings/pages/property_local_authority.rb
@@ -3,8 +3,8 @@ class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page
super
@id = "property_local_authority"
@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_after_2024?" => true, "address_search_given?" => true },
+ { "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_2024_or_later?" => true, "address_search_given?" => true },
]
end
diff --git a/app/models/form/lettings/pages/uprn.rb b/app/models/form/lettings/pages/uprn.rb
index 474928eb3..b9a3a4e94 100644
--- a/app/models/form/lettings/pages/uprn.rb
+++ b/app/models/form/lettings/pages/uprn.rb
@@ -14,7 +14,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
end
def skip_text
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
"Search for address instead"
else
"Enter address instead"
@@ -24,7 +24,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
def skip_href(log = nil)
return unless log
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
"address-matcher"
else
"address"
diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb
index b861cb39f..f35abe61e 100644
--- a/app/models/form/lettings/questions/age.rb
+++ b/app/models/form/lettings/questions/age.rb
@@ -27,7 +27,7 @@ class Form::Lettings::Questions::Age < ::Form::Question
end
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"
end
end
diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb
index 0e2fd5b2c..3261452cd 100644
--- a/app/models/form/lettings/questions/declaration.rb
+++ b/app/models/form/lettings/questions/declaration.rb
@@ -3,13 +3,13 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
super
@id = "declaration"
@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"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
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"
else
"The tenant has seen the MHCLG privacy notice"
@@ -19,7 +19,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
end
def unanswered_error_message
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
I18n.t("validations.declaration.missing.post_2024")
else
I18n.t("validations.declaration.missing.pre_2024")
diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb
index 40b99bc9f..74430d840 100644
--- a/app/models/form/lettings/questions/ethnic_white.rb
+++ b/app/models/form/lettings/questions/ethnic_white.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question
end
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" },
"2" => { "value" => "Irish" },
diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
index 9d54cfcb3..bc1c66cb4 100644
--- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
+++ b/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
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
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
QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze
diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb
index 75834d3bb..fc403d00c 100644
--- a/app/models/form/lettings/questions/housingneeds_other.rb
+++ b/app/models/form/lettings/questions/housingneeds_other.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => { "value" => "Yes" },
"0" => { "value" => "No" },
diff --git a/app/models/form/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb
index efb29a817..25dae3fc6 100644
--- a/app/models/form/lettings/questions/is_carehome.rb
+++ b/app/models/form/lettings/questions/is_carehome.rb
@@ -10,7 +10,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => { "value" => "Yes" },
"0" => { "value" => "No" },
diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb
index 63f99c36f..fdaad6c22 100644
--- a/app/models/form/lettings/questions/layear.rb
+++ b/app/models/form/lettings/questions/layear.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question
end
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" },
"2" => { "value" => "Less than 1 year" },
diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb
index 0ae7b740d..08310da13 100644
--- a/app/models/form/lettings/questions/letting_allocation.rb
+++ b/app/models/form/lettings/questions/letting_allocation.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
end
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." },
"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." },
diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb
index ec7a78969..d39cb49ff 100644
--- a/app/models/form/lettings/questions/person_relationship.rb
+++ b/app/models/form/lettings/questions/person_relationship.rb
@@ -10,7 +10,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"P" => { "value" => "Partner" },
"C" => { "value" => "Child" },
diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb
index 577571571..8c50cb41a 100644
--- a/app/models/form/lettings/questions/previous_let_type.rb
+++ b/app/models/form/lettings/questions/previous_let_type.rb
@@ -4,7 +4,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
@id = "unitletas"
@type = "radio"
@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]
end
diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb
index 4bc00ce43..3a659fc5c 100644
--- a/app/models/form/lettings/questions/reason.rb
+++ b/app/models/form/lettings/questions/reason.rb
@@ -14,7 +14,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question
end
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" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },
diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb
index 9a9ee72de..c00bd2581 100644
--- a/app/models/form/lettings/questions/reason_renewal.rb
+++ b/app/models/form/lettings/questions/reason_renewal.rb
@@ -14,7 +14,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
end
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" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },
diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb
index 904668a4b..98e5a9186 100644
--- a/app/models/form/lettings/questions/referral.rb
+++ b/app/models/form/lettings/questions/referral.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => {
"value" => "Internal transfer",
diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb
index 76ad3fbf8..96da2cba3 100644
--- a/app/models/form/lettings/questions/referral_prp.rb
+++ b/app/models/form/lettings/questions/referral_prp.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => {
"value" => "Internal transfer",
diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb
index 50822705e..d8d05fade 100644
--- a/app/models/form/lettings/questions/referral_supported_housing.rb
+++ b/app/models/form/lettings/questions/referral_supported_housing.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => {
"value" => "Internal transfer",
diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb
index cab8fbbc9..75cc218fe 100644
--- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb
+++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb
@@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => {
"value" => "Internal transfer",
diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb
index bc6934200..b941dfcc3 100644
--- a/app/models/form/lettings/questions/rent_type.rb
+++ b/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"
@type = "radio"
@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] }
@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
diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb
index 935980712..3f767d311 100644
--- a/app/models/form/lettings/questions/rsnvac.rb
+++ b/app/models/form/lettings/questions/rsnvac.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"14" => {
"value" => "Renewal of fixed-term tenancy",
diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb
index 7b80bb5bf..458772675 100644
--- a/app/models/form/lettings/questions/sheltered.rb
+++ b/app/models/form/lettings/questions/sheltered.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{ "1" => { "value" => "Yes – specialist retirement housing" },
"2" => { "value" => "Yes – extra care housing" },
"5" => { "value" => "Yes – sheltered housing for adults aged under 55 years" },
diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb
index 85d4a14ff..03d3fee88 100644
--- a/app/models/form/lettings/questions/starter_tenancy_type.rb
+++ b/app/models/form/lettings/questions/starter_tenancy_type.rb
@@ -10,7 +10,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term",
diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb
index 9a83b44cb..c67895bef 100644
--- a/app/models/form/lettings/questions/tenancy_type.rb
+++ b/app/models/form/lettings/questions/tenancy_type.rb
@@ -10,7 +10,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term",
diff --git a/app/models/form/lettings/questions/uprn_confirmation.rb b/app/models/form/lettings/questions/uprn_confirmation.rb
index 1c31485b6..2f03cb357 100644
--- a/app/models/form/lettings/questions/uprn_confirmation.rb
+++ b/app/models/form/lettings/questions/uprn_confirmation.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::UprnConfirmation < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => { "value" => "Yes" },
"0" => { "value" => "No, I want to search for the address instead" },
diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb
index 045765951..67a560167 100644
--- a/app/models/form/lettings/questions/waityear.rb
+++ b/app/models/form/lettings/questions/waityear.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"2" => { "value" => "Less than 1 year" },
"7" => { "value" => "1 year but under 2 years" },
diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb
index e95cdf19c..61334d84c 100644
--- a/app/models/form/lettings/subsections/household_characteristics.rb
+++ b/app/models/form/lettings/subsections/household_characteristics.rb
@@ -8,7 +8,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
def 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::NoFemalesPregnantHouseholdLeadHhmembValueCheck.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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2),
@@ -42,7 +42,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3),
@@ -62,7 +62,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4),
@@ -82,7 +82,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5),
@@ -102,7 +102,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6),
@@ -122,7 +122,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7),
@@ -142,7 +142,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7),
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::PersonKnown.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::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_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_2024_or_later?),
Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8),
@@ -162,7 +162,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
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::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::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self,
diff --git a/app/models/form/lettings/subsections/household_situation.rb b/app/models/form/lettings/subsections/household_situation.rb
index 6646d7230..dc3fd608b 100644
--- a/app/models/form/lettings/subsections/household_situation.rb
+++ b/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::ReasonForLeavingLastSettledHome.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::PreviousHousingSituationRenewal.new(nil, nil, self),
Form::Lettings::Pages::Homelessness.new("homelessness", nil, self),
diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb
index fa2ff0efa..c80e49e84 100644
--- a/app/models/form/lettings/subsections/property_information.rb
+++ b/app/models/form/lettings/subsections/property_information.rb
@@ -29,7 +29,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
end
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::UprnConfirmation.new(nil, nil, self),
@@ -48,7 +48,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
end
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
def displayed_in_tasklist?(log)
diff --git a/app/models/form/lettings/subsections/setup.rb b/app/models/form/lettings/subsections/setup.rb
index 1970149ed..0e65c2f13 100644
--- a/app/models/form/lettings/subsections/setup.rb
+++ b/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::TenantCode.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
end
diff --git a/app/models/form/lettings/subsections/tenancy_information.rb b/app/models/form/lettings/subsections/tenancy_information.rb
index 5525c182f..f0b7f4bef 100644
--- a/app/models/form/lettings/subsections/tenancy_information.rb
+++ b/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::TenancyLengthAffordableRent.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),
].flatten.compact
end
diff --git a/app/models/form/sales/pages/buyer1_nationality.rb b/app/models/form/sales/pages/buyer1_nationality.rb
index 6bcf12952..791ecafac 100644
--- a/app/models/form/sales/pages/buyer1_nationality.rb
+++ b/app/models/form/sales/pages/buyer1_nationality.rb
@@ -13,7 +13,7 @@ class Form::Sales::Pages::Buyer1Nationality < ::Form::Page
end
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::NationalityAll.new("nationality_all", nil, self, 1),
diff --git a/app/models/form/sales/pages/buyer2_nationality.rb b/app/models/form/sales/pages/buyer2_nationality.rb
index bbec2a105..30790fd63 100644
--- a/app/models/form/sales/pages/buyer2_nationality.rb
+++ b/app/models/form/sales/pages/buyer2_nationality.rb
@@ -15,7 +15,7 @@ class Form::Sales::Pages::Buyer2Nationality < ::Form::Page
end
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::NationalityAll.new("nationality_all_buyer2", nil, self, 2),
diff --git a/app/models/form/sales/pages/buyer_previous.rb b/app/models/form/sales/pages/buyer_previous.rb
index 0d20207a3..197a68971 100644
--- a/app/models/form/sales/pages/buyer_previous.rb
+++ b/app/models/form/sales/pages/buyer_previous.rb
@@ -13,7 +13,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page
end
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
end
diff --git a/app/models/form/sales/pages/deposit.rb b/app/models/form/sales/pages/deposit.rb
index f0bbda05c..4870a3c35 100644
--- a/app/models/form/sales/pages/deposit.rb
+++ b/app/models/form/sales/pages/deposit.rb
@@ -15,7 +15,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page
def routed_to?(log, _user)
return false unless super
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
end
diff --git a/app/models/form/sales/pages/deposit_discount.rb b/app/models/form/sales/pages/deposit_discount.rb
index caf726460..84fcbb45f 100644
--- a/app/models/form/sales/pages/deposit_discount.rb
+++ b/app/models/form/sales/pages/deposit_discount.rb
@@ -12,7 +12,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page
end
def depends_on
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
[{ "social_homebuy?" => true, "stairowned_100?" => @optional }]
else
[{ "social_homebuy?" => true }]
diff --git a/app/models/form/sales/pages/la_nominations.rb b/app/models/form/sales/pages/la_nominations.rb
index 6adda533d..e86e0374a 100644
--- a/app/models/form/sales/pages/la_nominations.rb
+++ b/app/models/form/sales/pages/la_nominations.rb
@@ -12,7 +12,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page
end
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
end
diff --git a/app/models/form/sales/pages/last_accommodation.rb b/app/models/form/sales/pages/last_accommodation.rb
index f9d167028..42620038b 100644
--- a/app/models/form/sales/pages/last_accommodation.rb
+++ b/app/models/form/sales/pages/last_accommodation.rb
@@ -13,7 +13,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page
end
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
end
diff --git a/app/models/form/sales/pages/last_accommodation_la.rb b/app/models/form/sales/pages/last_accommodation_la.rb
index 9cae326bf..ceb5b272c 100644
--- a/app/models/form/sales/pages/last_accommodation_la.rb
+++ b/app/models/form/sales/pages/last_accommodation_la.rb
@@ -16,7 +16,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page
end
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
end
diff --git a/app/models/form/sales/pages/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb
index 3d8e59383..bf51602a4 100644
--- a/app/models/form/sales/pages/managing_organisation.rb
+++ b/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)
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
return false unless organisation
diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb
index 649a445f9..fe9ad1bc0 100644
--- a/app/models/form/sales/pages/property_local_authority.rb
+++ b/app/models/form/sales/pages/property_local_authority.rb
@@ -3,8 +3,8 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
super
@id = "property_local_authority"
@depends_on = [
- { "is_la_inferred" => false, "form.start_year_after_2024?" => 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?" => false },
+ { "is_la_inferred" => false, "form.start_year_2024_or_later?" => true, "address_search_given?" => true },
]
end
diff --git a/app/models/form/sales/pages/uprn.rb b/app/models/form/sales/pages/uprn.rb
index fce51e543..a78b87c2f 100644
--- a/app/models/form/sales/pages/uprn.rb
+++ b/app/models/form/sales/pages/uprn.rb
@@ -13,7 +13,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
end
def skip_text
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
"Search for address instead"
else
"Enter address instead"
@@ -23,7 +23,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
def skip_href(log = nil)
return unless log
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
"address-matcher"
else
"address"
diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb
index 2bbe4939f..619c958f9 100644
--- a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb
+++ b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb
@@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
end
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" },
"2" => { "value" => "Irish" },
diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb
index 232e0f99e..be3e3ccff 100644
--- a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb
+++ b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb
@@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
end
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" },
"2" => { "value" => "Irish" },
diff --git a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
index 3f0fc299c..9520ace67 100644
--- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
+++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
@@ -16,7 +16,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"P" => { "value" => "Partner" },
diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb
index dfc0c2fd2..4daf963bf 100644
--- a/app/models/form/sales/questions/buyer_previous.rb
+++ b/app/models/form/sales/questions/buyer_previous.rb
@@ -22,7 +22,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
end
def derived?(_log)
- form.start_year_after_2024?
+ form.start_year_2024_or_later?
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze
diff --git a/app/models/form/sales/questions/discount.rb b/app/models/form/sales/questions/discount.rb
index 1d8c5a46b..3807a8cfc 100644
--- a/app/models/form/sales/questions/discount.rb
+++ b/app/models/form/sales/questions/discount.rb
@@ -5,7 +5,7 @@ class Form::Sales::Questions::Discount < ::Form::Question
@type = "numeric"
@copy_key = "sales.sale_information.discount"
@min = 0
- @max = form.start_year_after_2024? ? 70 : 100
+ @max = form.start_year_2024_or_later? ? 70 : 100
@step = 0.1
@width = 5
@suffix = "%"
diff --git a/app/models/form/sales/questions/mortgage_lender.rb b/app/models/form/sales/questions/mortgage_lender.rb
index c5a10efb4..a4aa55f17 100644
--- a/app/models/form/sales/questions/mortgage_lender.rb
+++ b/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
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
ANSWER_OPTIONS
else
ANSWER_OPTIONS.dup.reject { |k, _v| OPTIONS_INTRODUCED_2024.include?(k) }
diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb
index 341d3ff60..e4a101072 100644
--- a/app/models/form/sales/questions/mortgageused.rb
+++ b/app/models/form/sales/questions/mortgageused.rb
@@ -11,7 +11,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
end
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
elsif log.stairowned == 100 || log.outright_sale?
ANSWER_OPTIONS
diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb
index 6b33a2566..f42f03f37 100644
--- a/app/models/form/sales/questions/ownership_scheme.rb
+++ b/app/models/form/sales/questions/ownership_scheme.rb
@@ -7,7 +7,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question
end
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" },
"2" => { "value" => "Yes - a discounted ownership scheme" },
diff --git a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb
index af3f2a78b..9ac0791a4 100644
--- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb
+++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb
@@ -16,7 +16,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"P" => { "value" => "Partner" },
"C" => { "value" => "Child" },
diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb
index 57f77041b..5e73e7a3a 100644
--- a/app/models/form/sales/questions/privacy_notice.rb
+++ b/app/models/form/sales/questions/privacy_notice.rb
@@ -10,7 +10,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
end
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"
else
"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
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:)
else
I18n.t("validations.privacynotice.missing.pre_2024", buyer_or_buyers:)
diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb
index 94c1afa36..fed35f665 100644
--- a/app/models/form/sales/questions/uprn_confirmation.rb
+++ b/app/models/form/sales/questions/uprn_confirmation.rb
@@ -6,7 +6,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question
end
def answer_options
- if form.start_year_after_2024?
+ if form.start_year_2024_or_later?
{
"1" => { "value" => "Yes" },
"0" => { "value" => "No, I want to search for the address instead" },
diff --git a/app/models/form/sales/subsections/household_characteristics.rb b/app/models/form/sales/subsections/household_characteristics.rb
index afbbe4278..f1f01ba62 100644
--- a/app/models/form/sales/subsections/household_characteristics.rb
+++ b/app/models/form/sales/subsections/household_characteristics.rb
@@ -8,13 +8,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection
def 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", nil, self, joint_purchase: false) unless form.start_year_after_2024?),
- (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", nil, self, joint_purchase: false) 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_2024_or_later?),
+ (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_2024_or_later?),
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::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_value_check", nil, self, joint_purchase: false),
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::Buyer1WorkingSituation.new(nil, nil, self),
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::Buyer1LiveInProperty.new(nil, nil, self),
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_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::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::GenderIdentity2.new(nil, nil, self),
buyer_2_ethnicity_nationality_pages,
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::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::PersonStudentNotChildValueCheck.new("buyer_2_working_situation_student_not_child_value_check", nil, self, person_index: 2),
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::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::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_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_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_2024_or_later?),
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::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::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::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::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::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::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_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_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_2024_or_later?),
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::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::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::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::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::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::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_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_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_2024_or_later?),
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::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::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::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::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::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::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_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_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_2024_or_later?),
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::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::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::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::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::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::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_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_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_2024_or_later?),
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::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::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::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::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),
].flatten.compact
end
diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb
index 6b29313a1..af63c8179 100644
--- a/app/models/form/sales/subsections/outright_sale.rb
+++ b/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::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::MortgageLender.new("mortgage_lender_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_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_2024_or_later?),
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::Deposit.new("deposit_outright_sale", nil, self, ownershipsch: 3, optional: false),
diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb
index c59c159ae..32df98af5 100644
--- a/app/models/form/sales/subsections/property_information.rb
+++ b/app/models/form/sales/subsections/property_information.rb
@@ -21,7 +21,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
end
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::UprnConfirmation.new(nil, nil, self),
diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb
index 2f584c968..e5b5b3f84 100644
--- a/app/models/form/sales/subsections/setup.rb
+++ b/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::JointPurchase.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", nil, self, joint_purchase: false) if form.start_year_after_2024?),
- (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", nil, self, joint_purchase: false) 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_2024_or_later?),
+ (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_2024_or_later?),
].flatten.compact
end
end
diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb
index c955929dc..3fba8ef70 100644
--- a/app/models/form/sales/subsections/shared_ownership_scheme.rb
+++ b/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::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_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_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_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::MonthlyRent.new(nil, nil, self),
Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1),
diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb
index 7cab576c4..d8732c3ea 100644
--- a/app/models/lettings_log.rb
+++ b/app/models/lettings_log.rb
@@ -391,7 +391,7 @@ class LettingsLog < Log
end
def is_beds_inferred?
- form.start_year_after_2024? && is_bedsit?
+ form.start_year_2024_or_later? && is_bedsit?
end
def is_shared_housing?
@@ -899,7 +899,7 @@ private
def should_process_address_change?
return unless uprn_selection || select_best_address_match
return unless startdate
- return unless form.start_year_after_2024?
+ return unless form.start_year_2024_or_later?
if select_best_address_match
address_line1_input.present? && postcode_full_input.present?
diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb
index aca80ef94..23438142f 100644
--- a/app/models/sales_log.rb
+++ b/app/models/sales_log.rb
@@ -131,7 +131,7 @@ class SalesLog < Log
not_required << "proplen" if proplen_optional?
not_required << "mortlen" if mortlen_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
@@ -453,7 +453,7 @@ class SalesLog < Log
def should_process_address_change?
return unless uprn_selection || select_best_address_match
return unless saledate
- return unless form.start_year_after_2024?
+ return unless form.start_year_2024_or_later?
if select_best_address_match
address_line1_input.present? && postcode_full_input.present?
@@ -515,7 +515,7 @@ class SalesLog < Log
end
def soctenant_is_inferred?
- form.start_year_after_2024?
+ form.start_year_2024_or_later?
end
def duplicates
diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb
index 8fe940ae5..626925631 100644
--- a/app/models/validations/household_validations.rb
+++ b/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")
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)
record.errors.add :reason, I18n.t("validations.household.reason.other_not_settled")
@@ -56,7 +56,7 @@ module Validations::HouseholdValidations
end
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)
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}")
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 "age#{person_num}", I18n.t("validations.household.age.child_under_16_ecstat", person_num:)
end
@@ -86,7 +86,7 @@ module Validations::HouseholdValidations
end
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|
age = record.public_send("age#{person_num}")
@@ -101,7 +101,7 @@ module Validations::HouseholdValidations
end
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|
age = record.public_send("age#{person_num}")
diff --git a/app/models/validations/property_validations.rb b/app/models/validations/property_validations.rb
index 52afecb49..e0246ff1f 100644
--- a/app/models/validations/property_validations.rb
+++ b/app/models/validations/property_validations.rb
@@ -35,7 +35,7 @@ module Validations::PropertyValidations
def validate_shared_housing_rooms(record)
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 :beds, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit")
end
diff --git a/app/models/validations/sales/financial_validations.rb b/app/models/validations/sales/financial_validations.rb
index 9a119475f..c1046e035 100644
--- a/app/models/validations/sales/financial_validations.rb
+++ b/app/models/validations/sales/financial_validations.rb
@@ -54,7 +54,7 @@ module Validations::Sales::FinancialValidations
def validate_percentage_bought_not_equal_percentage_owned(record)
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
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)
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
formatted_equity = sprintf("%g", record.equity)
diff --git a/app/models/validations/sales/household_validations.rb b/app/models/validations/sales/household_validations.rb
index fb1ea65c2..23b2e9ee1 100644
--- a/app/models/validations/sales/household_validations.rb
+++ b/app/models/validations/sales/household_validations.rb
@@ -16,7 +16,7 @@ module Validations::Sales::HouseholdValidations
end
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
if [3, 4, 5, 6, 7, 9, 0].include?(record.prevten)
@@ -26,7 +26,7 @@ module Validations::Sales::HouseholdValidations
end
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|
age = record.public_send("age#{person_num}")
@@ -44,7 +44,7 @@ module Validations::Sales::HouseholdValidations
end
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|
age = record.public_send("age#{person_num}")
@@ -77,7 +77,7 @@ module Validations::Sales::HouseholdValidations
economic_status = record.public_send("ecstat#{person_num}")
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 "age#{person_num}", I18n.t("validations.sales.household.age.child_under_16_ecstat", person_num:)
end
@@ -89,7 +89,7 @@ module Validations::Sales::HouseholdValidations
end
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|
buyer_1_age = record.public_send("age1")
@@ -106,7 +106,7 @@ module Validations::Sales::HouseholdValidations
end
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 "ecstat2", I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat2) && record.joint_purchase?
diff --git a/app/models/validations/sales/property_validations.rb b/app/models/validations/sales/property_validations.rb
index 59d616c9a..c4a42c630 100644
--- a/app/models/validations/sales/property_validations.rb
+++ b/app/models/validations/sales/property_validations.rb
@@ -1,6 +1,6 @@
module Validations::Sales::PropertyValidations
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?
if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full
diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb
index 700867e66..3c5e3f2b9 100644
--- a/app/models/validations/sales/sale_information_validations.rb
+++ b/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")
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 :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_3_years_from_hodate")
end
@@ -42,7 +42,7 @@ module Validations::Sales::SaleInformationValidations
end
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.mortgage || record.mortgageused == 2 || record.mortgageused == 3
return unless record.discount || record.grant || record.type == 29
@@ -65,7 +65,7 @@ module Validations::Sales::SaleInformationValidations
end
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.mortgage_used? && record.mortgage
return unless record.deposit && record.value
@@ -96,7 +96,7 @@ module Validations::Sales::SaleInformationValidations
end
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)
unless record.grant.between?(9_000, 16_000)
@@ -106,7 +106,7 @@ module Validations::Sales::SaleInformationValidations
def validate_stairbought(record)
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
when 30, 16, 28, 31, 32
@@ -124,7 +124,7 @@ module Validations::Sales::SaleInformationValidations
end
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
if record.london_property? && record.discount_value > 136_400
@@ -139,7 +139,7 @@ module Validations::Sales::SaleInformationValidations
end
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.shared_ownership_scheme? && record.type && record.mortgageused && record.is_not_staircasing?
@@ -151,7 +151,7 @@ module Validations::Sales::SaleInformationValidations
end
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.shared_ownership_scheme? && record.type && record.mortgageused && record.is_staircase?
@@ -334,7 +334,7 @@ module Validations::Sales::SaleInformationValidations
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?")
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 :saledate, I18n.t("validations.sales.sale_information.saledate.mortgage_used_year")
end
diff --git a/app/models/validations/sales/soft_validations.rb b/app/models/validations/sales/soft_validations.rb
index fccd9bf83..fe05ec13c 100644
--- a/app/models/validations/sales/soft_validations.rb
+++ b/app/models/validations/sales/soft_validations.rb
@@ -68,7 +68,7 @@ module Validations::Sales::SoftValidations
end
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
extrabor != 1 && mortgage + deposit > value - value * discount / 100
@@ -118,7 +118,7 @@ module Validations::Sales::SoftValidations
def grant_outside_common_range?
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)
end
diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb
index a2ae916c1..2eb5fff5a 100644
--- a/app/models/validations/shared_validations.rb
+++ b/app/models/validations/shared_validations.rb
@@ -126,7 +126,7 @@ module Validations::SharedValidations
end
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}"]) }
if partner_numbers.count > 1
diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb
index b21099a06..97f495e0c 100644
--- a/app/services/exports/lettings_log_export_service.rb
+++ b/app/services/exports/lettings_log_export_service.rb
@@ -146,8 +146,8 @@ module Exports
field_name.starts_with?(details_known_prefix) ||
pattern_age.match(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_after_2024? && POST_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_2024_or_later? && POST_2024_EXPORT_FIELDS.include?(field_name))
end
def build_export_xml(lettings_logs)
diff --git a/app/views/logs/_create_for_org_actions.html.erb b/app/views/logs/_create_for_org_actions.html.erb
index 9b5935cb0..76b8f7d0d 100644
--- a/app/views/logs/_create_for_org_actions.html.erb
+++ b/app/views/logs/_create_for_org_actions.html.erb
@@ -1,13 +1,13 @@
-