diff --git a/app/models/form/sales/pages/joint_purchase.rb b/app/models/form/sales/pages/joint_purchase.rb new file mode 100644 index 000000000..305cfd31a --- /dev/null +++ b/app/models/form/sales/pages/joint_purchase.rb @@ -0,0 +1,17 @@ +class Form::Sales::Pages::JointPurchase < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "joint_purchase" + @header = "" + @description = "" + @subsection = subsection + }] + end + + def questions + @questions ||= [ + Form::Sales::Questions::JointPurchase.new(nil, nil, self), + ] + end + end + \ No newline at end of file diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb new file mode 100644 index 000000000..614972ae5 --- /dev/null +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -0,0 +1,18 @@ +class Form::Sales::Questions::JointPurchase < ::Form::Question + def initialize(id, hsh, page) + super + @id = "type" + @check_answer_label = "Joint purchase" + @header = "Is this a joint purchase?" + @hint_text = "" + @type = "radio" + @answer_options = ANSWER_OPTIONS + @page = page + end + + ANSWER_OPTIONS = { + "1" => { "value" => "Yes" }, + "0" => { "value" => "No" }, + }.freeze + end + \ No newline at end of file diff --git a/app/models/form/sales/setup/pages/created_by.rb b/app/models/form/sales/setup/pages/created_by.rb new file mode 100644 index 000000000..350eda0cb --- /dev/null +++ b/app/models/form/sales/setup/pages/created_by.rb @@ -0,0 +1,15 @@ +class Form::Setup::Pages::CreatedBy < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "created_by" + @header = "" + @description = "" + @subsection = subsection + end + + def questions + @questions ||= [ + Form::Setup::Questions::CreatedById.new(nil, nil, self), + ] + end +end diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index d72e44aa0..8bf8dcea9 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -13,6 +13,7 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection Form::Sales::Pages::SaleDate.new(nil, nil, self), Form::Sales::Pages::PurchaserCode.new(nil, nil, self), Form::Sales::Pages::SharedOwnershipType.new(nil, nil, self), + Form::Sales::Pages::JointPurchase.new(nil, nil, self), ] end end