Browse Source

Separate data_sharing_agreement_not_signed key for sales and lettings

pull/2744/head
Manny Dinssa 8 months ago
parent
commit
ca7392672c
  1. 6
      app/models/validations/shared_validations.rb
  2. 1
      config/locales/validations/lettings/setup.en.yml
  3. 1
      config/locales/validations/sales/setup.en.yml
  4. 8
      config/locales/validations/shared.en.yml

6
app/models/validations/shared_validations.rb

@ -124,7 +124,11 @@ module Validations::SharedValidations
return if record.skip_dpo_validation
if record.owning_organisation_id_changed? && record.owning_organisation.present? && !record.owning_organisation.data_protection_confirmed?
record.errors.add :owning_organisation_id, I18n.t("validations.shared.setup.owning_organisation.data_sharing_agreement_not_signed")
if record.sales?
record.errors.add :owning_organisation_id, I18n.t("validations.sales.setup.owning_organisation.data_sharing_agreement_not_signed")
else
record.errors.add :owning_organisation_id, I18n.t("validations.lettings.setup.owning_organisation.data_sharing_agreement_not_signed")
end
end
end

1
config/locales/validations/lettings/setup.en.yml

@ -54,6 +54,7 @@ en:
owning_organisation:
invalid: "Please select the owning organisation or managing organisation that you belong to."
data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
inactive:
merged_organisation:
"The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."

1
config/locales/validations/sales/setup.en.yml

@ -17,6 +17,7 @@ en:
"Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
owning_organisation:
data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
inactive:
merged_organisation:
"The owning organisation must be active on the sale completion date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."

8
config/locales/validations/shared.en.yml

@ -17,11 +17,3 @@ en:
date:
invalid_date: "Enter a date in the correct format, for example 31 1 2024."
setup:
owning_organisation:
data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."

Loading…
Cancel
Save