From b5b44d61ca855c6f0e9a730d2252e6ea46231fca Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Wed, 25 Feb 2026 16:11:20 +0000 Subject: [PATCH] CLDC-4169: remove VRTB option functionality --- .../form/sales/questions/discounted_ownership_type.rb | 11 ++++++++++- app/services/bulk_upload/sales/year2026/row_parser.rb | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index 9d8798f00..c00b6d9e2 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -5,7 +5,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question @copy_key = "sales.setup.type.discounted_ownership" @type = "radio" @top_guidance_partial = guidance_partial - @answer_options = ANSWER_OPTIONS + @answer_options = form.start_year_2026_or_later? ? ANSWER_OPTIONS_2026_OR_LATER : ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end @@ -19,6 +19,15 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question "22" => { "value" => "Any other equity loan scheme" }, }.freeze + ANSWER_OPTIONS_2026_OR_LATER = { + "8" => { "value" => "Right to Acquire (RTA)" }, + "14" => { "value" => "Preserved Right to Buy (PRTB)" }, + "9" => { "value" => "Right to Buy (RTB)" }, + "29" => { "value" => "Rent to Buy - Full Ownership" }, + "21" => { "value" => "Social HomeBuy for outright purchase" }, + "22" => { "value" => "Any other equity loan scheme" }, + }.freeze + def guidance_partial "discounted_ownership_type_definitions" if form.start_date.year >= 2023 end diff --git a/app/services/bulk_upload/sales/year2026/row_parser.rb b/app/services/bulk_upload/sales/year2026/row_parser.rb index 08d56fe37..39d0ace1d 100644 --- a/app/services/bulk_upload/sales/year2026/row_parser.rb +++ b/app/services/bulk_upload/sales/year2026/row_parser.rb @@ -366,7 +366,7 @@ class BulkUpload::Sales::Year2026::RowParser validates :field_11, inclusion: { - in: [8, 9, 14, 21, 22, 27, 29], + in: [8, 9, 14, 21, 22, 29], if: proc { field_11.present? }, category: :setup, question: QUESTIONS[:field_11].downcase, @@ -656,7 +656,7 @@ private end def rtb_like_sale_type? - [9, 14, 27, 29].include?(field_11) + [9, 14, 29].include?(field_11) end def field_mapping_for_errors