Browse Source

feat: add unable to find address errors when some options are returned if they are low confidence

CLDC-3339-update-selcet-correct-address-error
natdeanlewissoftwire 12 months ago
parent
commit
01617e2ea4
  1. 2
      app/services/bulk_upload/lettings/year2024/row_parser.rb
  2. 2
      app/services/bulk_upload/sales/year2024/row_parser.rb
  3. 2
      config/locales/en.yml

2
app/services/bulk_upload/lettings/year2024/row_parser.rb

@ -574,7 +574,7 @@ private
end end
def validate_address_option_found def validate_address_option_found
if !log.address_options_present? && field_16.blank? && (field_17.present? || field_19.present?) if log.uprn_selection.nil? && field_16.blank? && (field_17.present? || field_19.present?)
%i[field_17 field_18 field_19 field_20 field_21 field_22].each do |field| %i[field_17 field_18 field_19 field_20 field_21 field_22].each do |field|
errors.add(field, I18n.t("validations.no_address_found")) errors.add(field, I18n.t("validations.no_address_found"))
end end

2
app/services/bulk_upload/sales/year2024/row_parser.rb

@ -600,7 +600,7 @@ private
end end
def validate_address_option_found def validate_address_option_found
if !log.address_options_present? && field_22.blank? && (field_23.present? || field_25.present?) if log.uprn_selection.nil? && field_22.blank? && (field_23.present? || field_25.present?)
%i[field_23 field_24 field_25 field_26 field_27 field_28].each do |field| %i[field_23 field_24 field_25 field_26 field_27 field_28].each do |field|
errors.add(field, I18n.t("validations.no_address_found")) errors.add(field, I18n.t("validations.no_address_found"))
end end

2
config/locales/en.yml

@ -213,7 +213,7 @@ en:
not_answered: "You must answer %{question}" not_answered: "You must answer %{question}"
invalid_option: "Enter a valid value for %{question}" invalid_option: "Enter a valid value for %{question}"
invalid_number: "Enter a number for %{question}" invalid_number: "Enter a number for %{question}"
no_address_found: "We could not find this address. Edit the address data or fix this error on the CORE site." no_address_found: "We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address on the CORE site."
other_field_missing: "If %{main_field_label} is other then %{other_field_label} must be provided" other_field_missing: "If %{main_field_label} is other then %{other_field_label} must be provided"
other_field_not_required: "%{other_field_label} must not be provided if %{main_field_label} was not other" other_field_not_required: "%{other_field_label} must not be provided if %{main_field_label} was not other"

Loading…
Cancel
Save