diff --git a/app/services/bulk_upload/lettings/year2025/row_parser.rb b/app/services/bulk_upload/lettings/year2025/row_parser.rb index 0745056d2..c499cc9aa 100644 --- a/app/services/bulk_upload/lettings/year2025/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2025/row_parser.rb @@ -148,6 +148,28 @@ class BulkUpload::Lettings::Year2025::RowParser ERROR_BASE_KEY = "validations.lettings.2025.bulk_upload".freeze + CASE_INSENSITIVE_FIELDS = [ + :field_42, # What is the lead tenant’s age? + :field_48, # What is person 2’s age? + :field_52, # What is person 3’s age? + :field_56, # What is person 4’s age? + :field_60, # What is person 5’s age? + :field_64, # What is person 6’s age? + :field_68, # What is person 7’s age? + :field_72, # What is person 8’s age? + + :field_43, # Which of these best describes the lead tenant’s gender identity? + :field_49, # Which of these best describes person 2’s gender identity? + :field_53, # Which of these best describes person 3’s gender identity? + :field_57, # Which of these best describes person 4’s gender identity? + :field_61, # Which of these best describes person 5’s gender identity? + :field_65, # Which of these best describes person 6’s gender identity? + :field_69, # Which of these best describes person 7’s gender identity? + :field_73, # Which of these best describes person 8’s gender identity? + + :field_45, # What is the lead tenant’s nationality? + ].freeze + attribute :bulk_upload attribute :block_log_creation, :boolean, default: -> { false } @@ -459,6 +481,7 @@ class BulkUpload::Lettings::Year2025::RowParser return @valid = true if blank_row? + normalise_case_insensitive_fields super(:before_log) @before_errors = errors.dup @@ -560,6 +583,13 @@ class BulkUpload::Lettings::Year2025::RowParser private + def normalise_case_insensitive_fields + CASE_INSENSITIVE_FIELDS.each do |field| + value = send(field) + send("#{field}=", value.upcase) if value.present? + end + end + def validate_valid_radio_option log.attributes.each do |question_id, _v| question = log.form.get_question(question_id, log) diff --git a/app/services/bulk_upload/sales/year2025/row_parser.rb b/app/services/bulk_upload/sales/year2025/row_parser.rb index a78b9fe5d..f88174117 100644 --- a/app/services/bulk_upload/sales/year2025/row_parser.rb +++ b/app/services/bulk_upload/sales/year2025/row_parser.rb @@ -137,6 +137,32 @@ class BulkUpload::Sales::Year2025::RowParser field_121: "What are the total monthly leasehold charges for the property?", }.freeze + CASE_INSENSITIVE_FIELDS = [ + :field_28, # Age of buyer 1 + :field_35, # Age of person 2 + :field_43, # Age of person 3 + :field_47, # Age of person 4 + :field_51, # Age of person 5 + :field_55, # Age of person 6 + + :field_29, # Gender identity of buyer 1 + :field_36, # Gender identity of person 2 + :field_44, # Gender identity of person 3 + :field_48, # Gender identity of person 4 + :field_52, # Gender identity of person 5 + :field_56, # Gender identity of person 6 + + :field_31, # What is buyer 1’s nationality + :field_38, # What is buyer 2’s nationality + + :field_58, # What was buyer 1’s previous tenure? + :field_64, # What was buyer 2’s previous tenure? + + :field_75, # What is the total amount the buyers had in savings before they paid any deposit for the property? + :field_70, # What is buyer 1’s gross annual income? + :field_72, # What is buyer 2’s gross annual income? + ].freeze + ERROR_BASE_KEY = "validations.sales.2025.bulk_upload".freeze attribute :bulk_upload