Browse Source

Buyer Tenant nationality other answer option exclude UK

pull/3043/head
Manny Dinssa 1 month ago
parent
commit
509eb2098b
  1. 6
      app/models/form/lettings/questions/nationality_all.rb
  2. 6
      app/models/form/sales/questions/nationality_all.rb

6
app/models/form/lettings/questions/nationality_all.rb

@ -5,7 +5,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question
@copy_key = "lettings.household_characteristics.nationality_all.nationality_all"
@type = "select"
@check_answers_card_number = 1
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@answer_options = answer_options
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
@ -13,6 +13,10 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question
answer_options[log.nationality_all.to_s]["name"]
end
def answer_options
GlobalConstants::COUNTRIES_ANSWER_OPTIONS.except("826")
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze
def label_from_value(value)

6
app/models/form/sales/questions/nationality_all.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page, buyer_index)
super(id, hsh, page)
@type = "select"
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@answer_options = answer_options
@check_answers_card_number = buyer_index
@buyer_index = buyer_index
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_BUYER_INDEX.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_BUYER_INDEX.max_by { |k, _v| k }.last)[buyer_index]
@ -12,6 +12,10 @@ class Form::Sales::Questions::NationalityAll < ::Form::Question
answer_options[log.send(id).to_s]["name"]
end
def answer_options
GlobalConstants::COUNTRIES_ANSWER_OPTIONS.except("826")
end
QUESTION_NUMBER_FROM_YEAR_AND_BUYER_INDEX = {
2023 => { 1 => 24, 2 => 32 },
2024 => { 1 => 26, 2 => 34 },

Loading…
Cancel
Save