|
|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
class Form::Sales::Questions::Mortgageused < ::Form::Question |
|
|
|
|
def initialize(id, hsh, subsection, ownershipsch:) |
|
|
|
|
super(id, hsh, subsection) |
|
|
|
|
def initialize(id, hsh, page, ownershipsch:) |
|
|
|
|
super(id, hsh, page) |
|
|
|
|
@id = "mortgageused" |
|
|
|
|
@type = "radio" |
|
|
|
|
@answer_options = ANSWER_OPTIONS |
|
|
|
|
@ownershipsch = ownershipsch |
|
|
|
|
@question_number = question_number_from_year_and_ownership.fetch(form.start_date.year, question_number_from_year_and_ownership.max_by { |k, _v| k }.last)[ownershipsch] |
|
|
|
|
@question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR_AND_SECTION, value_key: form.start_year_2025_or_later? ? subsection.id : ownershipsch) |
|
|
|
|
@top_guidance_partial = top_guidance_partial |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@ -30,13 +30,12 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
|
|
|
|
|
ANSWER_OPTIONS.reject { |key, _v| %w[3 divider].include?(key) } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def question_number_from_year_and_ownership |
|
|
|
|
{ |
|
|
|
|
2023 => { 1 => 90, 2 => 103, 3 => 111 }, |
|
|
|
|
2024 => { 1 => 91, 2 => 104, 3 => 112 }, |
|
|
|
|
2025 => { 1 => subsection.id == "shared_ownership_staircasing_transaction" ? 99 : 82, 2 => 106 }, |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
QUESTION_NUMBER_FROM_YEAR_AND_SECTION = { |
|
|
|
|
2023 => { 1 => 90, 2 => 103, 3 => 111 }, |
|
|
|
|
2024 => { 1 => 91, 2 => 104, 3 => 112 }, |
|
|
|
|
2025 => { "shared_ownership_initial_purchase" => 82, "shared_ownership_staircasing_transaction" => 99, "discounted_ownership_scheme" => 106 }, |
|
|
|
|
2026 => { "shared_ownership_initial_purchase" => 82, "shared_ownership_staircasing_transaction" => 99, "discounted_ownership_scheme" => 106 }, |
|
|
|
|
}.freeze |
|
|
|
|
|
|
|
|
|
def top_guidance_partial |
|
|
|
|
return "financial_calculations_shared_ownership" if @ownershipsch == 1 |
|
|
|
|
|