From 1f2898a3b075bcee8e6384e5affd54fb2a957ebe Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Mon, 6 Mar 2023 16:03:18 +0000 Subject: [PATCH] feat: fix income duplication bug, add numbers to other questions --- app/models/form/sales/questions/buyer1_income_known.rb | 9 ++++++++- app/models/form/sales/questions/buyer2_income_known.rb | 9 ++++++++- app/models/form/sales/questions/other_nationality1.rb | 1 + app/models/form/sales/questions/other_ownership_type.rb | 1 + .../form/sales/questions/property_local_authority.rb | 1 + .../sales/questions/property_local_authority_known.rb | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/models/form/sales/questions/buyer1_income_known.rb b/app/models/form/sales/questions/buyer1_income_known.rb index f2b82b861..b5fb9e1f1 100644 --- a/app/models/form/sales/questions/buyer1_income_known.rb +++ b/app/models/form/sales/questions/buyer1_income_known.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "income1nk" - @check_answer_label = "Buyer 1’s gross annual income" + @check_answer_label = "Buyer 1’s gross annual income known?" @header = "Do you know buyer 1’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS @@ -11,6 +11,13 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question } @check_answers_card_number = 1 @question_number = 67 + @hidden_in_check_answers = { + "depends_on" => [ + { + "income1nk" => 0, + }, + ], + } end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_income_known.rb b/app/models/form/sales/questions/buyer2_income_known.rb index bc8692aff..7409383fa 100644 --- a/app/models/form/sales/questions/buyer2_income_known.rb +++ b/app/models/form/sales/questions/buyer2_income_known.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "income2nk" - @check_answer_label = "Buyer 2’s gross annual income" + @check_answer_label = "Buyer 2’s gross annual income known?" @header = "Do you know buyer 2’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS @@ -11,6 +11,13 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question } @check_answers_card_number = 2 @question_number = 69 + @hidden_in_check_answers = { + "depends_on" => [ + { + "income2nk" => 0, + }, + ], + } end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/other_nationality1.rb b/app/models/form/sales/questions/other_nationality1.rb index 3eb6a48d7..6225bf9a9 100644 --- a/app/models/form/sales/questions/other_nationality1.rb +++ b/app/models/form/sales/questions/other_nationality1.rb @@ -6,5 +6,6 @@ class Form::Sales::Questions::OtherNationality1 < ::Form::Question @header = "Nationality" @type = "text" @check_answers_card_number = 1 + @question_number = 24 end end diff --git a/app/models/form/sales/questions/other_ownership_type.rb b/app/models/form/sales/questions/other_ownership_type.rb index 428691381..08bd9955b 100644 --- a/app/models/form/sales/questions/other_ownership_type.rb +++ b/app/models/form/sales/questions/other_ownership_type.rb @@ -6,5 +6,6 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question @header = "What type of sale is it?" @type = "text" @width = 10 + @question_number = 6 end end diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb index 8def2d9f3..d06dc0fc8 100644 --- a/app/models/form/sales/questions/property_local_authority.rb +++ b/app/models/form/sales/questions/property_local_authority.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question @header = "What is the local authority of the property?" @type = "select" @answer_options = ANSWER_OPTIONS + @question_number = 16 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/property_local_authority_known.rb b/app/models/form/sales/questions/property_local_authority_known.rb index cbb534a06..7144f80a7 100644 --- a/app/models/form/sales/questions/property_local_authority_known.rb +++ b/app/models/form/sales/questions/property_local_authority_known.rb @@ -14,6 +14,7 @@ class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question }, ], } + @question_number = 16 end ANSWER_OPTIONS = {