diff --git a/app/models/forms/bulk_upload_lettings/prepare_your_file.rb b/app/models/forms/bulk_upload_lettings/prepare_your_file.rb index 75858e208..d9c055d27 100644 --- a/app/models/forms/bulk_upload_lettings/prepare_your_file.rb +++ b/app/models/forms/bulk_upload_lettings/prepare_your_file.rb @@ -33,6 +33,10 @@ module Forms "/files/bulk-upload-lettings-template-v1.xlsx" end + def specification_path + "/files/bulk-upload-lettings-specification-2022-23.xlsx" + end + def year_combo "#{year}/#{year + 1 - 2000}" end diff --git a/app/models/forms/bulk_upload_sales/prepare_your_file.rb b/app/models/forms/bulk_upload_sales/prepare_your_file.rb index 39ba0f487..e7de464cc 100644 --- a/app/models/forms/bulk_upload_sales/prepare_your_file.rb +++ b/app/models/forms/bulk_upload_sales/prepare_your_file.rb @@ -31,6 +31,10 @@ module Forms "/files/bulk-upload-sales-template-v1.xlsx" end + def specification_path + "/files/bulk-upload-sales-specification-2022-23.xlsx" + end + def year_combo "#{year}/#{year + 1 - 2000}" end diff --git a/app/models/location.rb b/app/models/location.rb index 3798c57e8..51943df3c 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -366,7 +366,7 @@ class Location < ApplicationRecord enum type_of_unit: TYPE_OF_UNIT - def self.find_by_id_on_mulitple_fields(id) + def self.find_by_id_on_multiple_fields(id) return if id.nil? where(id:).or(where(old_visible_id: id)).first diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 32d3540d1..279d60f49 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -48,7 +48,7 @@ class Organisation < ApplicationRecord validates :name, presence: { message: I18n.t("validations.organisation.name_missing") } validates :provider_type, presence: { message: I18n.t("validations.organisation.provider_type_missing") } - def self.find_by_id_on_mulitple_fields(id) + def self.find_by_id_on_multiple_fields(id) return if id.nil? if id.start_with?("ORG") diff --git a/app/models/scheme.rb b/app/models/scheme.rb index ca3624e3a..364809955 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -110,7 +110,7 @@ class Scheme < ApplicationRecord enum arrangement_type: ARRANGEMENT_TYPE, _suffix: true - def self.find_by_id_on_mulitple_fields(id) + def self.find_by_id_on_multiple_fields(id) return if id.nil? if id.start_with?("S") diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index 085a3662f..dcc4982af 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -217,7 +217,7 @@ private def location return if scheme.nil? - @location ||= scheme.locations.find_by_id_on_mulitple_fields(field_5) + @location ||= scheme.locations.find_by_id_on_multiple_fields(field_5) end def validate_location_exists @@ -584,7 +584,7 @@ private end def owning_organisation - Organisation.find_by_id_on_mulitple_fields(field_111) + Organisation.find_by_id_on_multiple_fields(field_111) end def owning_organisation_id @@ -592,7 +592,7 @@ private end def managing_organisation - Organisation.find_by_id_on_mulitple_fields(field_113) + Organisation.find_by_id_on_multiple_fields(field_113) end def managing_organisation_id @@ -991,6 +991,6 @@ private end def scheme - @scheme ||= Scheme.find_by_id_on_mulitple_fields(field_4) + @scheme ||= Scheme.find_by_id_on_multiple_fields(field_4) end end diff --git a/public/files/bulk-upload-lettings-specification-2022-23.xlsx b/public/files/bulk-upload-lettings-specification-2022-23.xlsx new file mode 100644 index 000000000..15cec38b6 Binary files /dev/null and b/public/files/bulk-upload-lettings-specification-2022-23.xlsx differ diff --git a/public/files/bulk-upload-sales-specification-2022-23.xlsx b/public/files/bulk-upload-sales-specification-2022-23.xlsx new file mode 100644 index 000000000..b1e825fbb Binary files /dev/null and b/public/files/bulk-upload-sales-specification-2022-23.xlsx differ