|
|
|
@ -287,6 +287,7 @@ class BulkUpload::Sales::Year2022::RowParser |
|
|
|
validate :validate_relevant_collection_window, on: :after_log |
|
|
|
validate :validate_relevant_collection_window, on: :after_log |
|
|
|
validate :validate_incomplete_soft_validations, on: :after_log |
|
|
|
validate :validate_incomplete_soft_validations, on: :after_log |
|
|
|
validate :validate_if_log_already_exists, on: :after_log, if: -> { FeatureToggle.bulk_upload_duplicate_log_check_enabled? } |
|
|
|
validate :validate_if_log_already_exists, on: :after_log, if: -> { FeatureToggle.bulk_upload_duplicate_log_check_enabled? } |
|
|
|
|
|
|
|
validate :validate_shared_ownership_type, on: :after_log, if: :shared_ownership? |
|
|
|
|
|
|
|
|
|
|
|
def self.question_for_field(field) |
|
|
|
def self.question_for_field(field) |
|
|
|
QUESTIONS[field] |
|
|
|
QUESTIONS[field] |
|
|
|
@ -1028,4 +1029,12 @@ private |
|
|
|
errors.add(:field_24, "Buyer 1 cannot be a child under 16") |
|
|
|
errors.add(:field_24, "Buyer 1 cannot be a child under 16") |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def validate_shared_ownership_type |
|
|
|
|
|
|
|
block_log_creation! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if sale_type == 32 |
|
|
|
|
|
|
|
errors.add(:field_8, I18n.t("validations.invalid_option", question: "shared ownership type"), category: :setup) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|