diff --git a/app/models/form/sales/pages/about_staircase.rb b/app/models/form/sales/pages/about_staircase.rb index fd740c10e..73ae5d342 100644 --- a/app/models/form/sales/pages/about_staircase.rb +++ b/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 diff --git a/app/models/form/sales/questions/staircase_sale.rb b/app/models/form/sales/questions/staircase_sale.rb new file mode 100644 index 000000000..fb56572cf --- /dev/null +++ b/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 diff --git a/db/migrate/20230210122037_add_staircasesale_to_sales_logs.rb b/db/migrate/20230210122037_add_staircasesale_to_sales_logs.rb new file mode 100644 index 000000000..824549cff --- /dev/null +++ b/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 diff --git a/db/schema.rb b/db/schema.rb index b9022d026..85a6b31cb 100644 --- a/db/schema.rb +++ b/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"