5 changed files with 42 additions and 1 deletions
@ -0,0 +1,15 @@ |
|||||||
|
class Form::Sales::Pages::BuyerInterview < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@id = "buyer_interview" |
||||||
|
@header = "" |
||||||
|
@description = "" |
||||||
|
@subsection = subsection |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::BuyerInterview.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
class Form::Sales::Questions::BuyerInterview < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "noint" |
||||||
|
@check_answer_label = "Buyer interviewed in person?" |
||||||
|
@header = "Was the buyer interviewed for any of the answers you will provide on this log?" |
||||||
|
@type = "radio" |
||||||
|
@hint_text = "You should still try to answer all questions even if the buyer wasn't interviewed in person" |
||||||
|
@page = page |
||||||
|
@answer_options = ANSWER_OPTIONS |
||||||
|
end |
||||||
|
|
||||||
|
ANSWER_OPTIONS = { |
||||||
|
"1" => { "value" => "No" }, |
||||||
|
"2" => { "value" => "Yes" }, |
||||||
|
}.freeze |
||||||
|
end |
||||||
@ -0,0 +1,7 @@ |
|||||||
|
class AddNointToSalesLog < ActiveRecord::Migration[7.0] |
||||||
|
def change |
||||||
|
change_table :sales_logs, bulk: true do |t| |
||||||
|
t.column :noint, :int |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue