From 3de4ce6293ef8dc9d3a9236e8962a0c0d871734d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 2 Mar 2026 12:19:19 +0000 Subject: [PATCH] CLDC-4174: copy sales log csv updates from CLDC-4176 --- app/services/csv/sales_log_csv_service.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/services/csv/sales_log_csv_service.rb b/app/services/csv/sales_log_csv_service.rb index 07ccad82c..b386b070f 100644 --- a/app/services/csv/sales_log_csv_service.rb +++ b/app/services/csv/sales_log_csv_service.rb @@ -249,7 +249,7 @@ module Csv return @attributes unless @user.support? mappings = SUPPORT_ATTRIBUTE_NAME_MAPPINGS - mappings = mappings.merge(SUPPORT_ATTRIBUTE_NAME_MAPPINGS_2025) if @year == 2025 + mappings = mappings.merge(SUPPORT_ATTRIBUTE_NAME_MAPPINGS_2025) if @year >= 2025 @attributes.map do |attribute| mappings[attribute] || attribute.upcase @@ -297,11 +297,10 @@ module Csv end def attribute_mappings - mappings = case @year - when 2024 - ATTRIBUTE_MAPPINGS.merge(ATTRIBUTE_MAPPINGS_2024) - when 2025 + mappings = if @year >= 2025 ATTRIBUTE_MAPPINGS.merge(ATTRIBUTE_MAPPINGS_2024).merge(ATTRIBUTE_MAPPINGS_2025) + elsif @year == 2024 + ATTRIBUTE_MAPPINGS.merge(ATTRIBUTE_MAPPINGS_2024) else ATTRIBUTE_MAPPINGS end @@ -348,6 +347,8 @@ module Csv %w[id status duplicate_set_id created_at updated_at collection_start_year creation_method bulk_upload_id is_dpo] when 2025 %w[id status duplicate_set_id created_at created_by_id updated_at updated_by_id creation_method bulk_upload_id] + when 2026 + %w[id status duplicate_set_id created_at created_by_id updated_at updated_by_id creation_method bulk_upload_id] else %w[id status duplicate_set_id created_at updated_at collection_start_year creation_method bulk_upload_id is_dpo] end