diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 84bfbb8f2..465eaed24 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -5,9 +5,9 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question @check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?" @header = "Declaration" @type = "checkbox" - @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_buyer_2024" : "privacy_notice_buyer" @question_number = 19 @joint_purchase = joint_purchase + @top_guidance_partial = guidance end def answer_options @@ -19,4 +19,12 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question { "privacynotice" => { "value" => declaration_text } }.freeze end + + def guidance + if form.start_year_after_2024? + @joint_purchase ? "privacy_notice_buyer_2024_joint_purchase" : "privacy_notice_buyer_2024" + else + @joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer" + end + end end diff --git a/app/models/validations/sales/financial_validations.rb b/app/models/validations/sales/financial_validations.rb index 9ad34a38b..331a352cf 100644 --- a/app/models/validations/sales/financial_validations.rb +++ b/app/models/validations/sales/financial_validations.rb @@ -48,7 +48,7 @@ module Validations::Sales::FinancialValidations return unless record.stairbought && record.stairowned if record.stairbought > record.stairowned - record.errors.add :stairowned, I18n.t("validations.financial.staircasing.percentage_bought_must_be_greater_than_percentage_owned", buyer_possessive: record.joint_purchase? ? "buyers" : "buyer") + record.errors.add :stairowned, I18n.t("validations.financial.staircasing.percentage_bought_must_be_greater_than_percentage_owned", buyer_now_owns: record.joint_purchase? ? "buyers now own" : "buyer now owns") end end diff --git a/app/models/validations/sales/property_validations.rb b/app/models/validations/sales/property_validations.rb index 64660753c..50818c422 100644 --- a/app/models/validations/sales/property_validations.rb +++ b/app/models/validations/sales/property_validations.rb @@ -4,10 +4,10 @@ module Validations::Sales::PropertyValidations return unless record.ppostcode_full.present? && record.postcode_full.present? if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full - record.errors.add :postcode_full, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers‘" : "Buyer‘s") - record.errors.add :ppostcode_full, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers‘" : "Buyer‘s") - record.errors.add :ownershipsch, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers‘" : "Buyer‘s") - record.errors.add :uprn, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers‘" : "Buyer‘s") + record.errors.add :postcode_full, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers’" : "Buyer’s") + record.errors.add :ppostcode_full, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers’" : "Buyer’s") + record.errors.add :ownershipsch, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers’" : "Buyer’s") + record.errors.add :uprn, I18n.t("validations.property.postcode.must_match_previous", buyer_possessive: record.joint_purchase? ? "Buyers’" : "Buyer’s") end end diff --git a/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb b/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb new file mode 100644 index 000000000..b2f4fd8ca --- /dev/null +++ b/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb @@ -0,0 +1 @@ +
Make sure the buyers have seen or been given access to <%= govuk_link_to "the Department for Levelling Up, Housing & Communities (DLUHC) privacy notice", privacy_notice_path, target: :_blank %> before completing this log. This is a legal requirement under data protection legislation.
diff --git a/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb b/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb new file mode 100644 index 000000000..772a2ee68 --- /dev/null +++ b/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb @@ -0,0 +1 @@ +Make sure the buyers have seen <%= govuk_link_to "the Department for Levelling Up, Housing & Communities (DLUHC) privacy notice", privacy_notice_path, target: :_blank %> before completing this log.
diff --git a/config/locales/en.yml b/config/locales/en.yml index 25e28547e..d8ad590c1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -428,7 +428,7 @@ en: not_provided: "Enter how much rent and other charges the household pays %{period}" cash_discount_invalid: "Cash discount must be £0 - £999,999" staircasing: - percentage_bought_must_be_greater_than_percentage_owned: "Total percentage %{buyer_possessive} now owns must be more than percentage bought in this transaction" + percentage_bought_must_be_greater_than_percentage_owned: "Total percentage %{buyer_now_owns} must be more than percentage bought in this transaction" percentage_bought_must_be_at_least_threshold: "The minimum increase in equity while staircasing is %{threshold}%" percentage_bought_equal_percentage_owned: "The percentage bought is %{stairbought}% and the percentage owned in total is %{stairowned}%. These figures cannot be the same." monthly_leasehold_charges: diff --git a/spec/models/validations/sales/financial_validations_spec.rb b/spec/models/validations/sales/financial_validations_spec.rb index d4ea510eb..6c8130e7a 100644 --- a/spec/models/validations/sales/financial_validations_spec.rb +++ b/spec/models/validations/sales/financial_validations_spec.rb @@ -153,7 +153,7 @@ RSpec.describe Validations::Sales::FinancialValidations do record.stairowned = 40 record.jointpur = 1 financial_validator.validate_percentage_bought_not_greater_than_percentage_owned(record) - expect(record.errors["stairowned"]).to include("Total percentage buyers now owns must be more than percentage bought in this transaction") + expect(record.errors["stairowned"]).to include("Total percentage buyers now own must be more than percentage bought in this transaction") end it "adds an error to stairowned and not stairbought if the percentage bought is more than the percentage owned for non joint purchase" do diff --git a/spec/models/validations/sales/property_validations_spec.rb b/spec/models/validations/sales/property_validations_spec.rb index e5b4e7077..6d4c0c9ae 100644 --- a/spec/models/validations/sales/property_validations_spec.rb +++ b/spec/models/validations/sales/property_validations_spec.rb @@ -51,9 +51,9 @@ RSpec.describe Validations::Sales::PropertyValidations do record.ppostcode_full = "SW1A 0AA" record.jointpur = 1 property_validator.validate_postcodes_match_if_discounted_ownership(record) - expect(record.errors["postcode_full"]).to include("Buyers‘ last accommodation and discounted ownership postcodes must match") - expect(record.errors["ppostcode_full"]).to include("Buyers‘ last accommodation and discounted ownership postcodes must match") - expect(record.errors["ownershipsch"]).to include("Buyers‘ last accommodation and discounted ownership postcodes must match") + expect(record.errors["postcode_full"]).to include("Buyers’ last accommodation and discounted ownership postcodes must match") + expect(record.errors["ppostcode_full"]).to include("Buyers’ last accommodation and discounted ownership postcodes must match") + expect(record.errors["ownershipsch"]).to include("Buyers’ last accommodation and discounted ownership postcodes must match") end it "when postcodes do not match an error is added for non joint purchase" do @@ -61,9 +61,9 @@ RSpec.describe Validations::Sales::PropertyValidations do record.ppostcode_full = "SW1A 0AA" record.jointpur = 2 property_validator.validate_postcodes_match_if_discounted_ownership(record) - expect(record.errors["postcode_full"]).to include("Buyer‘s last accommodation and discounted ownership postcodes must match") - expect(record.errors["ppostcode_full"]).to include("Buyer‘s last accommodation and discounted ownership postcodes must match") - expect(record.errors["ownershipsch"]).to include("Buyer‘s last accommodation and discounted ownership postcodes must match") + expect(record.errors["postcode_full"]).to include("Buyer’s last accommodation and discounted ownership postcodes must match") + expect(record.errors["ppostcode_full"]).to include("Buyer’s last accommodation and discounted ownership postcodes must match") + expect(record.errors["ownershipsch"]).to include("Buyer’s last accommodation and discounted ownership postcodes must match") end it "does not add error for 2024 log" do