7 changed files with 82 additions and 1 deletions
@ -0,0 +1,27 @@
|
||||
class Form::Sales::Pages::StaircaseBoughtValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "staircase_bought_value_check" |
||||
@depends_on = [ |
||||
{ |
||||
"staircase_bought_above_fifty?" => true, |
||||
}, |
||||
] |
||||
@title_text = { |
||||
"translation" => "soft_validations.staircase_bought_seems_high", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "stairbought", |
||||
"i18n_template" => "percentage", |
||||
} |
||||
] |
||||
} |
||||
@informative_text = {} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseBoughtValueCheck.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,23 @@
|
||||
class Form::Sales::Questions::StaircaseBoughtValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "staircase_bought_value_check" |
||||
@check_answer_label = "Percentage bought confirmation" |
||||
@header = "Are you sure this is correct?" |
||||
@type = "interruption_screen" |
||||
@answer_options = { |
||||
"0" => { "value" => "Yes" }, |
||||
"1" => { "value" => "No" }, |
||||
} |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"staircase_bought_value_check" => 0, |
||||
}, |
||||
{ |
||||
"staircase_bought_value_check" => 1, |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class AddStaircaseBoughtValueCheckToSalesLog < ActiveRecord::Migration[7.0] |
||||
def change |
||||
add_column :sales_logs, :staircase_bought_value_check, :integer |
||||
end |
||||
end |
||||
Loading…
Reference in new issue