Browse Source

feat: behaviour

pull/1286/head
natdeanlewissoftwire 3 years ago
parent
commit
6775b447b4
  1. 1
      app/models/form/sales/pages/about_staircase.rb
  2. 16
      app/models/form/sales/questions/staircase_sale.rb
  3. 5
      db/migrate/20230210122037_add_staircasesale_to_sales_logs.rb
  4. 5
      db/schema.rb

1
app/models/form/sales/pages/about_staircase.rb

@ -12,6 +12,7 @@ class Form::Sales::Pages::AboutStaircase < ::Form::Page
@questions ||= [
Form::Sales::Questions::StaircaseBought.new(nil, nil, self),
Form::Sales::Questions::StaircaseOwned.new(nil, nil, self),
Form::Sales::Questions::StaircaseSale.new(nil, nil, self),
]
end
end

16
app/models/form/sales/questions/staircase_sale.rb

@ -0,0 +1,16 @@
class Form::Sales::Questions::StaircaseSale < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircasesale"
@check_answer_label = "Part of a back-to-back staircasing transaction"
@header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
"3" => { "value" => "Don't know" },
}.freeze
end

5
db/migrate/20230210122037_add_staircasesale_to_sales_logs.rb

@ -0,0 +1,5 @@
class AddStaircasesaleToSalesLogs < ActiveRecord::Migration[7.0]
def change
add_column :sales_logs, :staircasesale, :integer
end
end

5
db/schema.rb

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_02_03_174815) do
ActiveRecord::Schema[7.0].define(version: 2023_02_10_122037) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -521,9 +521,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_03_174815) do
t.integer "old_persons_shared_ownership_value_check"
t.integer "staircase_bought_value_check"
t.integer "monthly_charges_value_check"
t.integer "saledate_check"
t.integer "details_known_5"
t.integer "details_known_6"
t.integer "saledate_check"
t.integer "staircasesale"
t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id"

Loading…
Cancel
Save