|
|
|
@ -410,6 +410,7 @@ class BulkUpload::Sales::Year2023::RowParser
|
|
|
|
|
validate :validate_incomplete_soft_validations, on: :after_log |
|
|
|
|
|
|
|
|
|
validate :validate_uprn_exists_if_any_key_address_fields_are_blank, on: :after_log |
|
|
|
|
validate :validate_uprn_not_in_scientific_notation, on: :after_log |
|
|
|
|
validate :validate_address_fields, on: :after_log |
|
|
|
|
validate :validate_if_log_already_exists, on: :after_log, if: -> { FeatureToggle.bulk_upload_duplicate_log_check_enabled? } |
|
|
|
|
|
|
|
|
@ -512,6 +513,12 @@ private
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate_uprn_not_in_scientific_notation |
|
|
|
|
if field_19&.include?("E") |
|
|
|
|
errors.add(:field_19, I18n.t("validations.invalid_option", question: "UPRN")) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate_address_fields |
|
|
|
|
if field_19.blank? || log.errors.attribute_names.include?(:uprn) |
|
|
|
|
if field_20.blank? |
|
|
|
|