Browse Source

feat: add boyer_company page and question (migration still to be committed)

pull/893/head
natdeanlewissoftwire 2 years ago
parent
commit
669c8678a8
  1. 15
      app/models/form/sales/pages/buyer_company.rb
  2. 17
      app/models/form/sales/questions/buyer_company.rb
  3. 1
      app/models/form/sales/subsections/setup.rb

15
app/models/form/sales/pages/buyer_company.rb

@ -0,0 +1,15 @@
class Form::Sales::Pages::BuyerCompany < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_company"
@header = ""
@description = ""
@subsection = subsection
end
def questions
@questions ||= [
Form::Sales::Questions::BuyerCompany.new(nil, nil, self),
]
end
end

17
app/models/form/sales/questions/buyer_company.rb

@ -0,0 +1,17 @@
class Form::Sales::Questions::BuyerCompany < ::Form::Question
def initialize(id, hsh, page)
super
@id = "companybuy"
@check_answer_label = "Company buyer"
@header = "Is the buyer a company?"
@hint_text = ""
@type = "radio"
@answer_options = ANSWER_OPTIONS
@page = page
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
end

1
app/models/form/sales/subsections/setup.rb

@ -16,6 +16,7 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection
Form::Sales::Pages::SharedOwnershipType.new(nil, nil, self),
Form::Sales::Pages::DiscountedOwnershipType.new(nil, nil, self),
Form::Sales::Pages::OutrightOwnershipType.new(nil, nil, self),
Form::Sales::Pages::BuyerCompany.new(nil, nil, self),
Form::Sales::Pages::BuyerLive.new(nil, nil, self),
Form::Sales::Pages::JointPurchase.new(nil, nil, self),
Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self),

Loading…
Cancel
Save