From b08b8d717c85b5449f6319c6fb9ea8095813967c Mon Sep 17 00:00:00 2001 From: magicmilo Date: Tue, 16 Nov 2021 11:28:17 +0000 Subject: [PATCH] CLDC-699-RemoveSaleCompletionDate --- config/forms/2021_2022.json | 31 ++++++++++++++------ db/migrate/20211116102527_change_datetime.rb | 10 +++++++ db/schema.rb | 10 +++---- spec/fixtures/complete_case_log.json | 3 +- 4 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20211116102527_change_datetime.rb diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 7433f4d7b..f7b8e8763 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -80,9 +80,8 @@ } }, "conditional_route_to": { - "tenant_same_property_renewal": { "sale_or_letting": "Letting" } - }, - "default_next_page" : "check_answers" + "sale_completion_date": { "sale_or_letting": "Sale" } + } }, "tenant_same_property_renewal": { "header": "About this log", @@ -100,7 +99,7 @@ } } }, - "tenancy_start_date": { + "startdate": { "header": "About this log", "description": "", "questions": { @@ -112,8 +111,8 @@ } } }, - "rent_type": { - "header": "About this log", + "about_this_letting": { + "header": "Tell us about this letting", "description": "", "questions": { "rent_type": { @@ -150,12 +149,25 @@ } } }, + "tenant_code": { + "header": "", + "description": "", + "questions": { + "tenant_code": { + "check_answer_label": "Tenant code", + "header": "What is the tenant code?", + "hint_text": "", + "type": "text" + } + }, + "default_next_page": "check_answers" + }, "sale_completion_date": { - "header": "About this log", + "header": "Sale Completion Date", "description": "", "questions": { "sale_completion_date": { - "check_answer_label": "What is the sale completion date?", + "check_answer_label": "Sale completion date", "header": "What is the sale completion date?", "hint_text": "For example, 27 3 2007", "type": "date" @@ -172,7 +184,8 @@ "hint_text": "", "type": "text" } - } + }, + "default_next_page": "check_answers" } } } diff --git a/db/migrate/20211116102527_change_datetime.rb b/db/migrate/20211116102527_change_datetime.rb new file mode 100644 index 000000000..f3b78282b --- /dev/null +++ b/db/migrate/20211116102527_change_datetime.rb @@ -0,0 +1,10 @@ +class ChangeDatetime < ActiveRecord::Migration[6.1] + def change + change_table :case_logs, bulk: true do |t| + t.remove :sale_completion_date + t.column :sale_completion_date, :datetime + t.remove :startdate + t.column :startdate, :datetime + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 614c895c2..fa2839c20 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.define(version: 2021_11_12_105348) do +ActiveRecord::Schema.define(version: 2021_11_16_102527) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -66,7 +66,6 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.string "accessibility_requirements" t.string "condition_effects" t.string "tenancy_code" - t.string "startdate" t.integer "startertenancy" t.integer "tenancylength" t.integer "tenancy" @@ -122,8 +121,6 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.integer "rp_dontknow" t.datetime "discarded_at" t.string "tenancyother" - t.integer "override_net_income_validation" - t.string "net_income_known" t.string "gdpr_acceptance" t.string "gdpr_declined" t.string "property_owner_organisation" @@ -133,8 +130,9 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.string "rent_type" t.string "intermediate_rent_product_name" t.string "needs_type" - t.string "sale_completion_date" t.string "purchaser_code" + t.integer "override_net_income_validation" + t.string "net_income_known" t.integer "reason" t.string "propcode" t.integer "majorrepairs" @@ -154,6 +152,8 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.integer "mrcyear" t.integer "other_hhmemb" t.integer "incref" + t.datetime "sale_completion_date" + t.datetime "startdate" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" end diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 81f2735fc..bb16bc42e 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -129,10 +129,9 @@ "rent_type": "", "intermediate_rent_product_name": "", "needs_type": "", - "sale_completion_date": "", + "sale_completion_date": "01/01/2020", "purchaser_code": "", "propcode": "123", - "majorrepairs": "Yes", "postcode": "a1", "postcod2": "w3", "ppostc1": "w3",