From 8de2833e9978867f9108ed8cae863165780448ae Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 30 Jun 2026 17:18:46 +0100 Subject: [PATCH] CLDC-4328: Update wrong field numbers error (#3319) * CLDC-4328: Update wrong field numbers error * fixup! CLDC-4328: Update wrong field numbers error * CLDC-4328: Use a specific error message per year/log type * fixup! 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 +- spec/services/bulk_upload/lettings/validator_spec.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 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..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 correct template." + 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 bf65ae6bd..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 correct template." + 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 48448c665..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 correct template." + 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 89291803e..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 correct template." + 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}." diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index ef5386cc9..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 correct template."]) + 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 correct template."]) + expect(validator.errors["base"]).to eql(["Incorrect number of fields, please ensure you have used the template for lettings #{year}."]) end end end