Browse Source

Add validation message for missing charge fields in bulk upload

CLDC-3987-Bug-fix-support-charge-validation
Manny Dinssa 2 weeks ago
parent
commit
e52e639faf
  1. 6
      app/services/bulk_upload/lettings/year2024/row_parser.rb
  2. 6
      app/services/bulk_upload/lettings/year2025/row_parser.rb
  3. 1
      config/locales/validations/lettings/2024/bulk_upload.en.yml
  4. 1
      config/locales/validations/lettings/2025/bulk_upload.en.yml

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

@ -937,10 +937,8 @@ private
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: charge))
end
other_charge_fields.each do |field, _charge|
blank_charge_fields.each do |_blank_field, blank_charge|
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: blank_charge))
end
other_charge_fields.each_key do |field|
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.related_to_missing_charge"))
end
end

6
app/services/bulk_upload/lettings/year2025/row_parser.rb

@ -936,10 +936,8 @@ private
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: charge))
end
other_charge_fields.each do |field, _charge|
blank_charge_fields.each do |_blank_field, blank_charge|
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: blank_charge))
end
other_charge_fields.each_key do |field|
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.related_to_missing_charge"))
end
end

1
config/locales/validations/lettings/2024/bulk_upload.en.yml

@ -58,6 +58,7 @@ en:
invalid: "Select a valid nationality."
charges:
missing_charges: "Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'."
related_to_missing_charge: "You must enter all these fields: basic rent, service charge, personal service charge and support charge. Please enter ‘0' for any types of charges that you don’t issue."
reasonpref:
conflict:
dont_know: "You cannot select 'Don't know' if any of the other reasonable preference reasons are also selected."

1
config/locales/validations/lettings/2025/bulk_upload.en.yml

@ -58,6 +58,7 @@ en:
invalid: "Select a valid nationality."
charges:
missing_charges: "Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'."
related_to_missing_charge: "You must enter all these fields: basic rent, service charge, personal service charge and support charge. Please enter ‘0' for any types of charges that you don’t issue."
reasonpref:
conflict:
dont_know: "You cannot select 'Don't know' if any of the other reasonable preference reasons are also selected."

Loading…
Cancel
Save