Browse Source

CLDC-4169: remove VRTB option functionality

pull/3202/head
Nat Dean-Lewis 3 weeks ago
parent
commit
b5b44d61ca
  1. 11
      app/models/form/sales/questions/discounted_ownership_type.rb
  2. 4
      app/services/bulk_upload/sales/year2026/row_parser.rb

11
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

4
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

Loading…
Cancel
Save