From f63da505ee8f32736f1fc1f0acc93d75bc66de97 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Mon, 20 Apr 2026 09:51:38 +0100 Subject: [PATCH 1/4] CLDC-4328: Update wrong field numbers error --- config/locales/validations/lettings/2025/bulk_upload.en.yml | 2 +- config/locales/validations/lettings/2026/bulk_upload.en.yml | 2 +- config/locales/validations/sales/2025/bulk_upload.en.yml | 2 +- config/locales/validations/sales/2026/bulk_upload.en.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/validations/lettings/2025/bulk_upload.en.yml b/config/locales/validations/lettings/2025/bulk_upload.en.yml index 5612750f7..886b8ac55 100644 --- a/config/locales/validations/lettings/2025/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2025/bulk_upload.en.yml @@ -12,7 +12,7 @@ en: wrong_template: wrong_template: "Incorrect start dates, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." over_max_column_count: "Too many columns, please ensure you have used the correct template." owning_organisation: not_found: "The owning organisation code is incorrect." diff --git a/config/locales/validations/lettings/2026/bulk_upload.en.yml b/config/locales/validations/lettings/2026/bulk_upload.en.yml index bf65ae6bd..e79d84715 100644 --- a/config/locales/validations/lettings/2026/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2026/bulk_upload.en.yml @@ -12,7 +12,7 @@ en: wrong_template: wrong_template: "Incorrect start dates, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." over_max_column_count: "Too many columns, please ensure you have used the correct template." owning_organisation: not_found: "The owning organisation code is incorrect." diff --git a/config/locales/validations/sales/2025/bulk_upload.en.yml b/config/locales/validations/sales/2025/bulk_upload.en.yml index 48448c665..418282081 100644 --- a/config/locales/validations/sales/2025/bulk_upload.en.yml +++ b/config/locales/validations/sales/2025/bulk_upload.en.yml @@ -11,7 +11,7 @@ en: wrong_template: over_max_column_count: "Too many columns, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." wrong_template: "Incorrect sale dates, please ensure you have used the correct template." numeric: within_range: "%{field} must be between %{min} and %{max}." diff --git a/config/locales/validations/sales/2026/bulk_upload.en.yml b/config/locales/validations/sales/2026/bulk_upload.en.yml index 89291803e..7ca5bba19 100644 --- a/config/locales/validations/sales/2026/bulk_upload.en.yml +++ b/config/locales/validations/sales/2026/bulk_upload.en.yml @@ -11,7 +11,7 @@ en: wrong_template: over_max_column_count: "Too many columns, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." wrong_template: "Incorrect sale dates, please ensure you have used the correct template." numeric: within_range: "%{field} must be between %{min} and %{max}." From 4c34db203e8dcaacb6377a49cd81ef83dc4f6bd5 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Mon, 20 Apr 2026 10:11:50 +0100 Subject: [PATCH 2/4] fixup! CLDC-4328: Update wrong field numbers error --- spec/services/bulk_upload/lettings/validator_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index ef5386cc9..f078d120d 100644 --- a/spec/services/bulk_upload/lettings/validator_spec.rb +++ b/spec/services/bulk_upload/lettings/validator_spec.rb @@ -55,7 +55,7 @@ RSpec.describe BulkUpload::Lettings::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the correct template."]) + expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year."]) end end @@ -72,7 +72,7 @@ RSpec.describe BulkUpload::Lettings::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the correct template."]) + expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year."]) end end end From 7092c5cd5b74f5191137359a07f58498311d650f Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 30 Apr 2026 15:09:30 +0100 Subject: [PATCH 3/4] CLDC-4328: Use a specific error message per year/log type --- config/locales/validations/lettings/2025/bulk_upload.en.yml | 2 +- config/locales/validations/lettings/2026/bulk_upload.en.yml | 2 +- config/locales/validations/sales/2025/bulk_upload.en.yml | 2 +- config/locales/validations/sales/2026/bulk_upload.en.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/validations/lettings/2025/bulk_upload.en.yml b/config/locales/validations/lettings/2025/bulk_upload.en.yml index 886b8ac55..e7d6fe6f1 100644 --- a/config/locales/validations/lettings/2025/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2025/bulk_upload.en.yml @@ -12,7 +12,7 @@ en: wrong_template: wrong_template: "Incorrect start dates, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for lettings 2025." over_max_column_count: "Too many columns, please ensure you have used the correct template." owning_organisation: not_found: "The owning organisation code is incorrect." diff --git a/config/locales/validations/lettings/2026/bulk_upload.en.yml b/config/locales/validations/lettings/2026/bulk_upload.en.yml index e79d84715..1206b7ad6 100644 --- a/config/locales/validations/lettings/2026/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2026/bulk_upload.en.yml @@ -12,7 +12,7 @@ en: wrong_template: wrong_template: "Incorrect start dates, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for lettings 2026." over_max_column_count: "Too many columns, please ensure you have used the correct template." owning_organisation: not_found: "The owning organisation code is incorrect." diff --git a/config/locales/validations/sales/2025/bulk_upload.en.yml b/config/locales/validations/sales/2025/bulk_upload.en.yml index 418282081..49c5e1bc1 100644 --- a/config/locales/validations/sales/2025/bulk_upload.en.yml +++ b/config/locales/validations/sales/2025/bulk_upload.en.yml @@ -11,7 +11,7 @@ en: wrong_template: over_max_column_count: "Too many columns, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for sales 2025." wrong_template: "Incorrect sale dates, please ensure you have used the correct template." numeric: within_range: "%{field} must be between %{min} and %{max}." diff --git a/config/locales/validations/sales/2026/bulk_upload.en.yml b/config/locales/validations/sales/2026/bulk_upload.en.yml index 7ca5bba19..6e3dc6a94 100644 --- a/config/locales/validations/sales/2026/bulk_upload.en.yml +++ b/config/locales/validations/sales/2026/bulk_upload.en.yml @@ -11,7 +11,7 @@ en: wrong_template: over_max_column_count: "Too many columns, please ensure you have used the correct template." no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the template for sales 2026." wrong_template: "Incorrect sale dates, please ensure you have used the correct template." numeric: within_range: "%{field} must be between %{min} and %{max}." From 2e9c7619f7842ecf8e932649c7559fc128609b12 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 30 Apr 2026 15:57:15 +0100 Subject: [PATCH 4/4] fixup! CLDC-4328: Use a specific error message per year/log type --- spec/services/bulk_upload/lettings/validator_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index f078d120d..38d4dbcbb 100644 --- a/spec/services/bulk_upload/lettings/validator_spec.rb +++ b/spec/services/bulk_upload/lettings/validator_spec.rb @@ -55,7 +55,7 @@ RSpec.describe BulkUpload::Lettings::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year."]) + expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for lettings #{year}."]) end end @@ -72,7 +72,7 @@ RSpec.describe BulkUpload::Lettings::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for the correct type (lettings or sales) and year."]) + expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for lettings #{year}."]) end end end