|
|
@ -396,6 +396,7 @@ class BulkUpload::Sales::Year2025::RowParser |
|
|
|
validate :validate_buyer1_economic_status, on: :before_log |
|
|
|
validate :validate_buyer1_economic_status, on: :before_log |
|
|
|
validate :validate_buyer2_economic_status, on: :before_log |
|
|
|
validate :validate_buyer2_economic_status, on: :before_log |
|
|
|
validate :validate_valid_radio_option, on: :before_log |
|
|
|
validate :validate_valid_radio_option, on: :before_log |
|
|
|
|
|
|
|
validate :validate_relat_fields, on: :before_log |
|
|
|
|
|
|
|
|
|
|
|
validate :validate_owning_org_data_given, on: :after_log |
|
|
|
validate :validate_owning_org_data_given, on: :after_log |
|
|
|
validate :validate_owning_org_exists, on: :after_log |
|
|
|
validate :validate_owning_org_exists, on: :after_log |
|
|
@ -1314,6 +1315,17 @@ private |
|
|
|
values[field_value] |
|
|
|
values[field_value] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def validate_relat_fields |
|
|
|
|
|
|
|
%i[field_34 field_42 field_46 field_50 field_54].each do |field| |
|
|
|
|
|
|
|
value = send(field) |
|
|
|
|
|
|
|
next if value.blank? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unless (1..3).cover?(value) |
|
|
|
|
|
|
|
errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field]))) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def validate_managing_org_related |
|
|
|
def validate_managing_org_related |
|
|
|
if owning_organisation && managing_organisation && !owning_organisation.can_be_managed_by?(organisation: managing_organisation) |
|
|
|
if owning_organisation && managing_organisation && !owning_organisation.can_be_managed_by?(organisation: managing_organisation) |
|
|
|
block_log_creation! |
|
|
|
block_log_creation! |
|
|
|