Browse Source

CLDC-4190: Remove other validations on referral fields

CLDC-4191-referral-question-csv-xml
Samuel Young 2 weeks ago
parent
commit
7c575098d5
  1. 14
      app/services/bulk_upload/lettings/year2026/row_parser.rb
  2. 2
      config/locales/validations/lettings/2026/bulk_upload.en.yml

14
app/services/bulk_upload/lettings/year2026/row_parser.rb

@ -414,8 +414,6 @@ class BulkUpload::Lettings::Year2026::RowParser
validate :validate_needs_type_present, on: :after_log
validate :validate_data_types, on: :after_log
validate :validate_relevant_collection_window, on: :after_log
validate :validate_la_with_local_housing_referral, on: :after_log
validate :validate_cannot_be_la_referral_if_general_needs_and_la, on: :after_log
validate :validate_leaving_reason_for_renewal, on: :after_log
validate :validate_only_one_housing_needs_type, on: :after_log
validate :validate_no_disabled_needs_conjunction, on: :after_log
@ -805,18 +803,6 @@ private
field_4 == 2
end
def validate_cannot_be_la_referral_if_general_needs_and_la
if field_116 == 4 && general_needs? && owning_organisation && owning_organisation.la?
errors.add :field_116, I18n.t("#{ERROR_BASE_KEY}.referral.general_needs_prp_referred_by_la")
end
end
def validate_la_with_local_housing_referral
if field_116 == 3 && owning_organisation && owning_organisation.la?
errors.add(:field_116, I18n.t("#{ERROR_BASE_KEY}.referral.nominated_by_local_ha_but_la"))
end
end
def validate_relevant_collection_window
return if startdate.blank? || bulk_upload.form.blank?

2
config/locales/validations/lettings/2026/bulk_upload.en.yml

@ -40,8 +40,6 @@ en:
reason:
renewal_reason_needed: "The reason for leaving must be \"End of social or private sector tenancy - no fault\", \"End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)\", \"End of social or private sector tenancy - evicted due to rent arrears\" or \"End of social or private sector tenancy - evicted for any other reason\"."
referral:
general_needs_prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log."
nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority."
invalid_option: "Your answers for each part of \"What is the source of referral for this letting?\" are incompatible with each other. Use the bulk upload specification or paper form to see which combinations are valid (available from ‘Collection resources’ on the homepage)."
scheme:
must_relate_to_org: "This scheme code does not belong to the owning organisation or managing organisation."

Loading…
Cancel
Save