11 changed files with 69 additions and 5 deletions
@ -0,0 +1,21 @@
|
||||
class Form::Sales::Pages::Person2Known < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "person_2_known" |
||||
@header_partial = "personx_known_page" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
@depends_on = [ |
||||
{ "hholdcount" => 2 }, |
||||
{ "hholdcount" => 3 }, |
||||
{ "hholdcount" => 4 }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::Person2Known.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,25 @@
|
||||
class Form::Sales::Questions::Person2Known < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "details_known_2" |
||||
@check_answer_label = "Details known for person 2" |
||||
@header = "Do you know the details for person 2? |
||||
" |
||||
@type = "radio" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@page = page |
||||
@hint_text = "" |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"details_known_2" => 1, |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"1" => { "value" => "Yes" }, |
||||
"2" => { "value" => "No" }, |
||||
}.freeze |
||||
end |
@ -0,0 +1 @@
|
||||
You have given us the details for 1 of the <%= hholdcount %> other people in the household |
@ -0,0 +1,7 @@
|
||||
class AddDetailsKnownToSalesLog < ActiveRecord::Migration[7.0] |
||||
change_table :sales_logs, bulk: true do |t| |
||||
t.column :details_known_2, :integer |
||||
t.column :details_known_3, :integer |
||||
t.column :details_known_4, :integer |
||||
end |
||||
end |
Loading…
Reference in new issue