Browse Source

feat: add sales guidance methods

CLDC-3196-update-bu-resources-link
natdeanlewissoftwire 11 months ago
parent
commit
68da3e4907
  1. 2
      app/models/forms/bulk_upload_lettings/guidance.rb
  2. 19
      app/models/forms/bulk_upload_sales/guidance.rb

2
app/models/forms/bulk_upload_lettings/guidance.rb

@ -40,7 +40,7 @@ module Forms
end end
def download_text(lettings_or_sales, file, new_or_legacy = nil) def download_text(lettings_or_sales, file, new_or_legacy = nil)
"Download the #{lettings_or_sales} bulk upload #{file} (#{year_combo_full})#{new_or_legacy_text(new_or_legacy) if year == 2023 and new_or_legacy.present?}" "Download the #{lettings_or_sales} bulk upload #{file} (#{year_combo_full})#{new_or_legacy_text(new_or_legacy) if (year == 2023) && new_or_legacy.present?}"
end end
def year_combo def year_combo

19
app/models/forms/bulk_upload_sales/guidance.rb

@ -38,6 +38,25 @@ module Forms
def sales_specification_path def sales_specification_path
Forms::BulkUploadSales::PrepareYourFile.new(year:).specification_path Forms::BulkUploadSales::PrepareYourFile.new(year:).specification_path
end end
def download_text(lettings_or_sales, file, new_or_legacy = nil)
"Download the #{lettings_or_sales} bulk upload #{file} (#{year_combo_full})#{new_or_legacy_text(new_or_legacy) if (year == 2023) && new_or_legacy.present?}"
end
def year_combo
"#{year}/#{year - 2000 + 1}"
end
def year_combo_full
"#{year} to #{year + 1}"
end
def new_or_legacy_text(new_or_legacy)
case new_or_legacy
when "new" then " – New question ordering"
when "legacy" then " – Legacy version"
end
end
end end
end end
end end

Loading…
Cancel
Save