Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
788 B

class Form::Sales::Questions::MortgageLength < ::Form::Question
def initialize(id, hsh, page, ownershipsch:)
super(id, hsh, page)
@id = "mortlen"
@type = "numeric"
@min = 0
@max = 60
@step = 1
@width = 5
@ownershipsch = ownershipsch
@question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR_AND_SECTION, value_key: form.start_year_2026_or_later? ? subsection.id : ownershipsch)
end
def suffix_label(log)
" #{'year'.pluralize(log[id])}"
end
QUESTION_NUMBER_FROM_YEAR_AND_SECTION = {
2023 => { 1 => 93, 2 => 106, 3 => 114 },
2024 => { 1 => 94, 2 => 107, 3 => 114 },
2025 => { 1 => 84, 2 => 108 },
2026 => { "shared_ownership_initial_purchase" => 92, "discounted_ownership_scheme" => 118 },
}.freeze
end