natdeanlewissoftwire
2 years ago
6 changed files with 60 additions and 1 deletions
@ -0,0 +1,18 @@ |
|||||||
|
class Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@id = "about_price_shared_ownership_value_check" |
||||||
|
@depends_on = [ |
||||||
|
{ |
||||||
|
"purchase_price_out_of_expected_range?" => true, |
||||||
|
}, |
||||||
|
] |
||||||
|
@informative_text = {} |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::AboutPriceSharedOwnershipValueCheck.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,27 @@ |
|||||||
|
class Form::Sales::Questions::AboutPriceSharedOwnershipValueCheck < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "value_value_check" |
||||||
|
@check_answer_label = "Deposit confirmation" |
||||||
|
@header = "Are you sure? You said purchase price was #{log.value}, which seems #{value_is_high?(log.value) ? 'high' : 'low'}" |
||||||
|
@type = "interruption_screen" |
||||||
|
@answer_options = { |
||||||
|
"0" => { "value" => "Yes" }, |
||||||
|
"1" => { "value" => "No" }, |
||||||
|
} |
||||||
|
@hidden_in_check_answers = { |
||||||
|
"depends_on" => [ |
||||||
|
{ |
||||||
|
"value_value_check" => 0, |
||||||
|
}, |
||||||
|
{ |
||||||
|
"value_value_check" => 1, |
||||||
|
}, |
||||||
|
], |
||||||
|
} |
||||||
|
end |
||||||
|
|
||||||
|
def value_is_high?(value) |
||||||
|
true |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,5 @@ |
|||||||
|
class AddAboutPriceSharedOwnershipValueCheckToSalesLog < ActiveRecord::Migration[7.0] |
||||||
|
def change |
||||||
|
add_column :sales_logs, :value_value_check, :integer |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue