natdeanlewissoftwire
2 years ago
6 changed files with 65 additions and 1 deletions
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Pages::BuyersOrganisations < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "buyers_organisations" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::BuyersOrganisations.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,19 @@
|
||||
class Form::Sales::Questions::BuyersOrganisations < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id="organisations_buyers" |
||||
@check_answer_label = "Organisations buyers were registered with" |
||||
@header = "What organisations were the buyers registered with?" |
||||
@type = "checkbox" |
||||
@hint_text = "Select all that apply" |
||||
@page = page |
||||
@answer_options = ANSWER_OPTIONS |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"pregyrha" => { "value" => "Their private registered provider (PRP)- housing association" }, |
||||
"pregother" => { "value" => "Other private registered provider (PRP)- housing association" }, |
||||
"pregla" => { "value" => "Local Authority" }, |
||||
"pregghb" => { "value" => "Help to Buy Agent" }, |
||||
}.freeze |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Subsections::HouseholdSituation < ::Form::Subsection |
||||
def initialize(id, hsh, section) |
||||
super |
||||
@id = "household_situation" |
||||
@label = "Household situation" |
||||
@section = section |
||||
@depends_on = [{ "setup_completed?" => true }] |
||||
end |
||||
|
||||
def pages |
||||
@pages ||= [ |
||||
Form::Sales::Pages::BuyersOrganisations.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,10 @@
|
||||
class AddBuyersOrganisationsToSalesLog < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :sales_logs, bulk: true do |t| |
||||
t.column :pregyrha, :int |
||||
t.column :pregla, :int |
||||
t.column :pregghb, :int |
||||
t.column :pregother, :integer |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue