diff --git a/app/models/form/sales/pages/handover_date_check.rb b/app/models/form/sales/pages/handover_date_check.rb index 735354480..e8d666f60 100644 --- a/app/models/form/sales/pages/handover_date_check.rb +++ b/app/models/form/sales/pages/handover_date_check.rb @@ -6,7 +6,7 @@ class Form::Sales::Pages::HandoverDateCheck < ::Form::Page { "saledate_check" => 1, "hodate_3_years_or_more_saledate?" => true }] @informative_text = {} @title_text = { - "translation" => "validations.sale_information.hodate.must_be_less_than_3_years_from_saledate_soft", + "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate", "arguments" => [], } end diff --git a/app/models/form/sales/pages/sale_date_check.rb b/app/models/form/sales/pages/sale_date_check.rb index f77d7154f..61d7b7cfb 100644 --- a/app/models/form/sales/pages/sale_date_check.rb +++ b/app/models/form/sales/pages/sale_date_check.rb @@ -6,7 +6,7 @@ class Form::Sales::Pages::SaleDateCheck < ::Form::Page { "hodate_check" => 1, "hodate_3_years_or_more_saledate?" => true }] @informative_text = {} @title_text = { - "translation" => "validations.sale_information.saledate.must_be_less_than_3_years_from_hodate_soft", + "translation" => "soft_validations.saledate.must_be_less_than_3_years_from_hodate", "arguments" => [], } end diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index 4239c2759..71c6b0c69 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -13,7 +13,7 @@ module Validations::Sales::SaleInformationValidations end if record.saledate - record.hodate >= 3.years && record.form.start_year_after_2024? - record.errors.add :hodate, :over_a_year_from_saledate, message: I18n.t("validations.sale_information.hodate.must_be_less_than_3_years_from_saledate") + record.errors.add :hodate, message: I18n.t("validations.sale_information.hodate.must_be_less_than_3_years_from_saledate") record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_less_than_3_years_from_hodate") end end diff --git a/config/locales/en.yml b/config/locales/en.yml index bde9cec5a..254851304 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -606,7 +606,6 @@ en: rent_to_buy: "Rent to Buy buyers should not have lived here before" hodate: must_be_before_saledate: "Practical completion or handover date must be before sale completion date" - must_be_less_than_3_years_from_saledate_soft: "You told us practical completion or handover date is more than 3 years before sale completion date" must_be_less_than_3_years_from_saledate: "Practical completion or handover date must be less than 3 years before sale completion date" exdate: must_be_before_saledate: "Contract exchange date must be before sale completion date" @@ -615,7 +614,6 @@ en: must_be_after_exdate: "Sale completion date must be after contract exchange date" must_be_less_than_1_year_from_exdate: "Sale completion date must be less than 1 year after contract exchange date" must_be_less_than_3_years_from_hodate: "Sale completion date must be less than 3 years after practical completion or handover date" - must_be_less_than_3_years_from_hodate_soft: "You told us sale completion date is more than 3 years after practical completion or handover date" must_be_after_hodate: "Sale completion date must be after practical completion or handover date" previous_property_type: property_type_bedsit: "A bedsit cannot have more than 1 bedroom" @@ -750,6 +748,11 @@ Make sure these answers are correct." informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + hodate: + must_be_less_than_3_years_from_saledate: "You told us practical completion or handover date is more than 3 years before sale completion date" + saledate: + must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date" + devise: email: diff --git a/spec/models/form/sales/pages/handover_date_check_spec.rb b/spec/models/form/sales/pages/handover_date_check_spec.rb index bc614ae7f..9f60fa20f 100644 --- a/spec/models/form/sales/pages/handover_date_check_spec.rb +++ b/spec/models/form/sales/pages/handover_date_check_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "validations.sale_information.hodate.must_be_less_than_3_years_from_saledate_soft", + "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate", "arguments" => [], }) end diff --git a/spec/models/form/sales/pages/sale_date_check_spec.rb b/spec/models/form/sales/pages/sale_date_check_spec.rb index 85576cedc..d87a4be45 100644 --- a/spec/models/form/sales/pages/sale_date_check_spec.rb +++ b/spec/models/form/sales/pages/sale_date_check_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Form::Sales::Pages::SaleDateCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "validations.sale_information.saledate.must_be_less_than_3_years_from_hodate_soft", + "translation" => "soft_validations.saledate.must_be_less_than_3_years_from_hodate", "arguments" => [], }) end