Browse Source

CLDC-2439: min and max rent value check questions created

pull/1718/head
Aaron Spencer 3 years ago
parent
commit
08b02983d7
  1. 2
      app/models/form/lettings/pages/max_rent_value_check.rb
  2. 2
      app/models/form/lettings/pages/min_rent_value_check.rb
  3. 19
      app/models/form/lettings/questions/max_rent_value_check.rb
  4. 19
      app/models/form/lettings/questions/min_rent_value_check.rb

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

@ -26,7 +26,7 @@ class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page
end end
def questions def questions
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] @questions ||= [Form::Lettings::Questions::MaxRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)]
end end
def interruption_screen_question_ids def interruption_screen_question_ids

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

@ -22,7 +22,7 @@ class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page
end end
def questions def questions
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] @questions ||= [Form::Lettings::Questions::MinRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)]
end end
def interruption_screen_question_ids def interruption_screen_question_ids

19
app/models/form/lettings/questions/max_rent_value_check.rb

@ -0,0 +1,19 @@
class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "max_rent_value_check"
@check_answer_label = "Total rent confirmation"
@header = "Are you sure this is correct?"
@type = "interruption_screen"
@hint_text = hint_text
@check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "max_rent_value_check" => 0 }, { "max_rent_value_check" => 1 }] }
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze
def hint_text
"This is higher than we would expect. Check:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the rent type is correct, for example affordable or social rent</li></ul>"
end
end

19
app/models/form/lettings/questions/min_rent_value_check.rb

@ -0,0 +1,19 @@
class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "min_rent_value_check"
@check_answer_label = "Total rent confirmation"
@header = "Are you sure this is correct?"
@type = "interruption_screen"
@hint_text = hint_text
@check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "min_rent_value_check" => 0 }, { "min_rent_value_check" => 1 }] }
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze
def hint_text
"This is lower than we would expect. Check:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the rent type is correct, for example affordable or social rent</li></ul>"
end
end
Loading…
Cancel
Save