Browse Source

CLDC-4173: add new buildheightclass bu and export updates

pull/3186/head
Nat Dean-Lewis 1 month ago
parent
commit
f3dfa4c6ed
  1. 3
      app/helpers/bulk_upload/sales_log_to_csv.rb
  2. 4
      app/services/bulk_upload/sales/year2026/csv_parser.rb
  3. 4
      app/services/bulk_upload/sales/year2026/row_parser.rb
  4. 2
      app/services/exports/sales_log_export_constants.rb

3
app/helpers/bulk_upload/sales_log_to_csv.rb

@ -672,7 +672,8 @@ class BulkUpload::SalesLogToCsv
log.sexrab3,
log.sexrab4,
log.sexrab5,
log.sexrab6, # 127
log.sexrab6,
log.buildheightclass, # 128
]
end

4
app/services/bulk_upload/sales/year2026/csv_parser.rb

@ -4,7 +4,7 @@ class BulkUpload::Sales::Year2026::CsvParser
include CollectionTimeHelper
# TODO: CLDC-4162: Update when 2026 format is known
FIELDS = 127
FIELDS = 128
FORM_YEAR = 2026
attr_reader :path
@ -27,7 +27,7 @@ class BulkUpload::Sales::Year2026::CsvParser
def cols
# TODO: CLDC-4162: Update when 2026 format is known
@cols ||= ("A".."DR").to_a
@cols ||= ("A".."DS").to_a
end
def row_parsers

4
app/services/bulk_upload/sales/year2026/row_parser.rb

@ -142,6 +142,7 @@ class BulkUpload::Sales::Year2026::RowParser
field_125: "Person 4's sex, as registered at birth",
field_126: "Person 5's sex, as registered at birth",
field_127: "Person 6's sex, as registered at birth",
field_128: "What is the building height classification?",
}.freeze
ERROR_BASE_KEY = "validations.sales.2026.bulk_upload".freeze
@ -288,6 +289,7 @@ class BulkUpload::Sales::Year2026::RowParser
attribute :field_125, :string
attribute :field_126, :string
attribute :field_127, :string
attribute :field_128, :integer
validates :field_1,
presence: {
@ -801,6 +803,7 @@ private
sexrab4: %i[field_125],
sexrab5: %i[field_126],
sexrab6: %i[field_127],
buildheightclass: %i[field_128],
}
end
@ -842,6 +845,7 @@ private
attributes["sexrab4"] = field_125
attributes["sexrab5"] = field_126
attributes["sexrab6"] = field_127
attributes["buildheightclass"] = field_128
attributes["relat2"] = relationship_from_is_partner(field_34)
attributes["relat3"] = relationship_from_is_partner(field_42)

2
app/services/exports/sales_log_export_constants.rb

@ -146,7 +146,7 @@ module Exports::SalesLogExportConstants
ALL_YEAR_EXPORT_FIELDS << "RELAT#{index}"
end
YEAR_2026_EXPORT_FIELDS = Set[]
YEAR_2026_EXPORT_FIELDS = Set["BUILDHEIGHTCLASS"]
(1..6).each do |index|
YEAR_2026_EXPORT_FIELDS << "SEXRAB#{index}"

Loading…
Cancel
Save