natdeanlewissoftwire
2 years ago
8 changed files with 56 additions and 8 deletions
@ -0,0 +1,21 @@
|
||||
class Form::Sales::Pages::Person1RelationshipToBuyer1JointPurchase < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "person_1_relationship_to_buyer_1_joint_purchase" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
@depends_on = [ |
||||
{ "hholdcount" => 1, "jointpur" => 1 }, |
||||
{ "hholdcount" => 2, "jointpur" => 1 }, |
||||
{ "hholdcount" => 3, "jointpur" => 1 }, |
||||
{ "hholdcount" => 4, "jointpur" => 1 }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::Person1RelationshipToBuyer1JointPurchase.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,20 @@
|
||||
class Form::Sales::Questions::Person1RelationshipToBuyer1JointPurchase < ::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 = 3 |
||||
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 |
@ -0,0 +1,5 @@
|
||||
class AddPerson1RelationshipToBuyer1ToSalesLog < ActiveRecord::Migration[7.0] |
||||
change_table :sales_logs, bulk: true do |t| |
||||
t.column :relat3, :string |
||||
end |
||||
end |
Loading…
Reference in new issue