Browse Source

Backfill repeating tenancy question

pull/1254/head
Kat 3 years ago
parent
commit
d883bbeeaf
  1. 2
      app/models/form/lettings/pages/starter_tenancy_type.rb
  2. 20
      app/models/form/lettings/questions/starter_tenancy.rb
  3. 13
      app/models/form/lettings/questions/tenancy.rb

2
app/models/form/lettings/pages/starter_tenancy_type.rb

@ -8,6 +8,6 @@ class Form::Lettings::Pages::StarterTenancyType < ::Form::Page
end
def questions
@questions ||= [Form::Lettings::Questions::Tenancy.new(nil, nil, self), Form::Lettings::Questions::Tenancyother.new(nil, nil, self)]
@questions ||= [Form::Lettings::Questions::StarterTenancy.new(nil, nil, self), Form::Lettings::Questions::Tenancyother.new(nil, nil, self)]
end
end

20
app/models/form/lettings/questions/starter_tenancy.rb

@ -0,0 +1,20 @@
class Form::Lettings::Questions::StarterTenancy < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tenancy"
@check_answer_label = "Type of main tenancy after the starter period has ended?"
@header = "What is the type of tenancy after the starter period has ended?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "This is also known as an ‘introductory period’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tenancyother" => [3] }
end
ANSWER_OPTIONS = { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term" },
"6" => { "value" => "Secure – fixed term" },
"2" => { "value" => "Assured – lifetime" },
"7" => { "value" => "Secure – lifetime" },
"5" => { "value" => "Licence agreement" },
"3" => { "value" => "Other" } }.freeze
end

13
app/models/form/lettings/questions/tenancy.rb

@ -2,14 +2,19 @@ class Form::Lettings::Questions::Tenancy < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tenancy"
@check_answer_label = "Type of main tenancy after the starter period has ended?"
@header = "What is the type of tenancy after the starter period has ended?"
@check_answer_label = "Type of main tenancy"
@header = "What is the type of tenancy?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "This is also known as an ‘introductory period’."
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tenancyother" => [3] }
end
ANSWER_OPTIONS = { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term" }, "6" => { "value" => "Secure – fixed term" }, "2" => { "value" => "Assured – lifetime" }, "7" => { "value" => "Secure – lifetime" }, "5" => { "value" => "Licence agreement" }, "3" => { "value" => "Other" } }.freeze
ANSWER_OPTIONS = { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term" },
"6" => { "value" => "Secure – fixed term" },
"2" => { "value" => "Assured – lifetime" },
"7" => { "value" => "Secure – lifetime" },
"5" => { "value" => "Licence agreement" },
"3" => { "value" => "Other" } }.freeze
end

Loading…
Cancel
Save