diff --git a/app/models/form/sales/pages/person1_relationship_to_buyer1.rb b/app/models/form/sales/pages/person1_relationship_to_buyer1.rb new file mode 100644 index 000000000..57182563a --- /dev/null +++ b/app/models/form/sales/pages/person1_relationship_to_buyer1.rb @@ -0,0 +1,21 @@ +class Form::Sales::Pages::Person1RelationshipToBuyer1 < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "person_1_relationship_to_buyer_1" + @header = "" + @description = "" + @subsection = subsection + @depends_on = [ + { "hholdcount" => 1 }, + { "hholdcount" => 2 }, + { "hholdcount" => 3 }, + { "hholdcount" => 4 }, + ] + end + + def questions + @questions ||= [ + Form::Sales::Questions::Person1RelationshipToBuyer1.new(nil, nil, self), + ] + end +end diff --git a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb index 4564a2381..a7782d8db 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -12,7 +12,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question end ANSWER_OPTIONS = { - "P" => { "value" => "Parent" }, + "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "R" => { "value" => "Buyer prefers not to say" }, diff --git a/app/models/form/sales/questions/person1_relationship_to_buyer1.rb b/app/models/form/sales/questions/person1_relationship_to_buyer1.rb new file mode 100644 index 000000000..089d14ad6 --- /dev/null +++ b/app/models/form/sales/questions/person1_relationship_to_buyer1.rb @@ -0,0 +1,20 @@ +class Form::Sales::Questions::Person1RelationshipToBuyer1 < ::Form::Question + def initialize(id, hsh, page) + super + @id = "relat3" + @check_answer_label = "Person 1's relationship to buyer 1" + @header = "What is person 1's relationship to buyer 1?" + @type = "radio" + @hint_text = "" + @page = page + @answer_options = ANSWER_OPTIONS + @check_answers_card_number = 2 + end + + ANSWER_OPTIONS = { + "P" => { "value" => "Partner" }, + "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, + "X" => { "value" => "Other" }, + "R" => { "value" => "Buyer prefers not to say" }, + }.freeze +end diff --git a/app/models/form/sales/subsections/household_characteristics.rb b/app/models/form/sales/subsections/household_characteristics.rb index a2232caa2..4e3728494 100644 --- a/app/models/form/sales/subsections/household_characteristics.rb +++ b/app/models/form/sales/subsections/household_characteristics.rb @@ -29,6 +29,7 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self), Form::Sales::Pages::NumberOfOthersInProperty.new(nil, nil, self), Form::Sales::Pages::Person1Known.new(nil, nil, self), + Form::Sales::Pages::Person1RelationshipToBuyer1.new(nil, nil, self), Form::Sales::Pages::Person1Age.new(nil, nil, self), Form::Sales::Pages::Person1GenderIdentity.new(nil, nil, self), Form::Sales::Pages::Person1GenderIdentityJointPurchase.new(nil, nil, self), diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index 742c12ac0..86c4fddd5 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model it "has the correct answer_options" do expect(question.answer_options).to eq({ - "P" => { "value" => "Parent" }, + "P" => { "value" => "Partner" }, "C" => { "value" => "Child", "hint" => "Must be eligible for child benefit, aged under 16 or under 20 if still in full-time education." }, "X" => { "value" => "Other" }, "R" => { "value" => "Buyer prefers not to say" },