|
|
|
@ -337,14 +337,6 @@ class BulkUpload::Lettings::Year2023::RowParser |
|
|
|
}, |
|
|
|
}, |
|
|
|
on: :after_log |
|
|
|
on: :after_log |
|
|
|
|
|
|
|
|
|
|
|
validates :field_15, |
|
|
|
|
|
|
|
presence: { |
|
|
|
|
|
|
|
if: proc { supported_housing? && log_uses_old_scheme_id? }, |
|
|
|
|
|
|
|
message: I18n.t("validations.not_answered", question: "management group code"), |
|
|
|
|
|
|
|
category: :setup, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
on: :after_log |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validates :field_16, |
|
|
|
validates :field_16, |
|
|
|
presence: { |
|
|
|
presence: { |
|
|
|
if: proc { supported_housing? }, |
|
|
|
if: proc { supported_housing? }, |
|
|
|
@ -353,14 +345,6 @@ class BulkUpload::Lettings::Year2023::RowParser |
|
|
|
}, |
|
|
|
}, |
|
|
|
on: :after_log |
|
|
|
on: :after_log |
|
|
|
|
|
|
|
|
|
|
|
validates :field_17, |
|
|
|
|
|
|
|
presence: { |
|
|
|
|
|
|
|
if: proc { supported_housing? && log_uses_new_scheme_id? }, |
|
|
|
|
|
|
|
message: I18n.t("validations.not_answered", question: "location code"), |
|
|
|
|
|
|
|
category: :setup, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
on: :after_log |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validates :field_46, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 1 must be a number or the letter R" }, on: :after_log |
|
|
|
validates :field_46, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 1 must be a number or the letter R" }, on: :after_log |
|
|
|
validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 2 must be a number or the letter R" }, allow_blank: true, on: :after_log |
|
|
|
validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 2 must be a number or the letter R" }, allow_blank: true, on: :after_log |
|
|
|
validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 3 must be a number or the letter R" }, allow_blank: true, on: :after_log |
|
|
|
validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 3 must be a number or the letter R" }, allow_blank: true, on: :after_log |
|
|
|
@ -762,7 +746,7 @@ private |
|
|
|
def validate_location_data_given |
|
|
|
def validate_location_data_given |
|
|
|
if supported_housing? && location_id.blank? && location_field.present? |
|
|
|
if supported_housing? && location_id.blank? && location_field.present? |
|
|
|
block_log_creation! |
|
|
|
block_log_creation! |
|
|
|
errors.add(location_field, I18n.t("validations.not_answered", question: "#{location_or_scheme} code"), category: "setup") |
|
|
|
errors.add(location_field, I18n.t("validations.not_answered", question: "#{location_or_scheme} code"), category: :setup) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -776,7 +760,7 @@ private |
|
|
|
def validate_scheme_data_given |
|
|
|
def validate_scheme_data_given |
|
|
|
if supported_housing? && scheme_field.present? && scheme_id.blank? |
|
|
|
if supported_housing? && scheme_field.present? && scheme_id.blank? |
|
|
|
block_log_creation! |
|
|
|
block_log_creation! |
|
|
|
errors.add(scheme_field, I18n.t("validations.not_answered", question: "#{scheme_or_management_group} code"), category: "setup") |
|
|
|
errors.add(scheme_field, I18n.t("validations.not_answered", question: "#{scheme_or_management_group} code"), category: :setup) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|