5 changed files with 44 additions and 2 deletions
			
			
		@ -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 | 
				
			||||
@ -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 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue