Browse Source

Extract form years

pull/1665/head
Kat 3 years ago
parent
commit
7ac8147ce9
  1. 3
      app/services/bulk_upload/lettings/year2023/csv_parser.rb
  2. 3
      app/services/bulk_upload/sales/year2023/csv_parser.rb

3
app/services/bulk_upload/lettings/year2023/csv_parser.rb

@ -5,6 +5,7 @@ class BulkUpload::Lettings::Year2023::CsvParser
FIELDS = 134 FIELDS = 134
MAX_COLUMNS = 142 MAX_COLUMNS = 142
FORM_YEAR = 2023
attr_reader :path attr_reader :path
@ -64,7 +65,7 @@ class BulkUpload::Lettings::Year2023::CsvParser
end end
def correct_template_for_year? def correct_template_for_year?
collection_start_year_for_date(first_record_start_date) == 2023 collection_start_year_for_date(first_record_start_date) == FORM_YEAR
rescue Date::Error rescue Date::Error
true true
end end

3
app/services/bulk_upload/sales/year2023/csv_parser.rb

@ -4,6 +4,7 @@ class BulkUpload::Sales::Year2023::CsvParser
include CollectionTimeHelper include CollectionTimeHelper
MAX_COLUMNS = 142 MAX_COLUMNS = 142
FORM_YEAR = 2023
attr_reader :path attr_reader :path
@ -49,7 +50,7 @@ class BulkUpload::Sales::Year2023::CsvParser
end end
def correct_template_for_year? def correct_template_for_year?
collection_start_year_for_date(first_record_start_date) == 2023 collection_start_year_for_date(first_record_start_date) == FORM_YEAR
rescue Date::Error rescue Date::Error
true true
end end

Loading…
Cancel
Save