Browse Source

switch renewal field

pull/95/head
magicmilo 3 years ago
parent
commit
903726eda6
  1. 24
      config/forms/2021_2022.json
  2. 1
      db/migrate/20211119104835_add_property_info_fields.rb
  3. 6
      db/schema.rb
  4. 2
      spec/factories/case_log.rb
  5. 3
      spec/fixtures/complete_case_log.json
  6. 179
      spec/fixtures/forms/test_aboutthislog.json

24
config/forms/2021_2022.json

@ -81,14 +81,14 @@
"header": "About this log",
"description": "Is this a renewal to the same tenant in the same property?",
"questions": {
"renewal": {
"tenant_same_property_renewal": {
"check_answer_label": "",
"header": "Is this a renewal to the same tenant in the same property?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
"0": "No",
"1": "Yes"
}
}
},
@ -1516,7 +1516,7 @@
}
}
},
"depends_on": { "renewal": "No"}
"depends_on": { "tenant_same_property_renewal": "No"}
},
"type_property_most_recently_let_as": {
"header": "",
@ -1535,7 +1535,7 @@
}
}
},
"depends_on": { "first_time_property_let_as_social_housing": "No", "renewal": "No" }
"depends_on": { "first_time_property_let_as_social_housing": "No", "tenant_same_property_renewal": "No" }
},
"property_vacancy_reason_not_first_let": {
"header": "",
@ -1561,7 +1561,7 @@
}
}
},
"depends_on": { "first_time_property_let_as_social_housing": "No", "renewal": "No" }
"depends_on": { "first_time_property_let_as_social_housing": "No", "tenant_same_property_renewal": "No" }
},
"property_vacancy_reason_first_let": {
"header": "",
@ -1579,7 +1579,7 @@
}
}
},
"depends_on": { "first_time_property_let_as_social_housing": "Yes", "renewal": "No" }
"depends_on": { "first_time_property_let_as_social_housing": "Yes", "tenant_same_property_renewal": "No" }
},
"property_number_of_times_relet_not_social_let": {
"header": "",
@ -1595,7 +1595,7 @@
"step": 1
}
},
"depends_on": { "first_time_property_let_as_social_housing": "No", "renewal": "No" }
"depends_on": { "first_time_property_let_as_social_housing": "No", "tenant_same_property_renewal": "No" }
},
"property_number_of_times_relet_social_let": {
"header": "",
@ -1611,7 +1611,7 @@
"step": 1
}
},
"depends_on": { "first_time_property_let_as_social_housing": "Yes", "renewal": "No" }
"depends_on": { "first_time_property_let_as_social_housing": "Yes", "tenant_same_property_renewal": "No" }
},
"property_unit_type": {
"header": "",
@ -1694,7 +1694,7 @@
"type": "date"
}
},
"depends_on": { "rsnvac": "First let of newbuild property", "renewal": "No" }
"depends_on": { "rsnvac": "First let of newbuild property", "tenant_same_property_renewal": "No" }
},
"property_major_repairs": {
"header": "",
@ -1712,7 +1712,7 @@
"conditional_for": {
"mrcdate": ["Yes"]
},
"depends_on": { "renewal": "No" }
"depends_on": { "tenant_same_property_renewal": "No" }
},
"mrcdate": {
"check_answer_label": "What was the major repairs completion date?",
@ -1740,7 +1740,7 @@
"mrcdate": ["Yes"]
},
"depends_on": {
"renewal": "No",
"tenant_same_property_renewal": "No",
"rsnvac": ["First let of conversion, rehabilitation or acquired property?", "First let of leased property"]
}
}

1
db/migrate/20211119104835_add_property_info_fields.rb

@ -5,7 +5,6 @@ class AddPropertyInfoFields < ActiveRecord::Migration[6.1]
t.column :why_dont_you_know_la, :string
t.column :type_property_most_recently_let_as, :string
t.column :builtype, :string
t.rename :tenant_same_property_renewal, :renewal
end
end
end

6
db/schema.rb

@ -137,7 +137,7 @@ ActiveRecord::Schema.define(version: 2021_11_19_120910) do
t.string "property_owner_organisation"
t.string "property_manager_organisation"
t.string "sale_or_letting"
t.string "renewal"
t.string "tenant_same_property_renewal"
t.string "rent_type"
t.string "intermediate_rent_product_name"
t.string "needs_type"
@ -163,12 +163,12 @@ ActiveRecord::Schema.define(version: 2021_11_19_120910) do
t.integer "incref"
t.datetime "sale_completion_date"
t.datetime "startdate"
t.integer "armedforces"
t.string "property_postcode"
t.integer "first_time_property_let_as_social_housing"
t.string "why_dont_you_know_la"
t.string "type_property_most_recently_let_as"
t.string "builtype"
t.integer "armedforces"
t.string "property_postcode"
t.index ["discarded_at"], name: "index_case_logs_on_discarded_at"
end

2
spec/factories/case_log.rb

@ -54,7 +54,7 @@ FactoryBot.define do
lettype { "Affordable Rent - General Needs" }
landlord { "This landlord" }
previous_postcode { "SE2 6RT" }
rsnvac { "Relet - tenant abandoned property" }
rsnvac { "Tenant abandoned property" }
unittype_gn { "House" }
property_building_type { "dummy" }
beds { 3 }

3
spec/fixtures/complete_case_log.json vendored

@ -127,7 +127,6 @@
"property_owner_organisation": "",
"property_manager_organisation": "",
"sale_or_letting": "",
"tenant_same_property_renewal": "",
"rent_type": "",
"intermediate_rent_product_name": "",
"needs_type": "",
@ -145,7 +144,7 @@
"builtype": "Purpose built",
"property_wheelchair_accessible": "Yes",
"void_or_renewal_date": "05/05/2020",
"renewal": "Yes",
"tenant_same_property_renewal": "Yes",
"new_build_handover_date": "01/01/2019"
}
}

179
spec/fixtures/forms/test_aboutthislog.json vendored

@ -1,179 +0,0 @@
{
"form_type": "lettings",
"sections": {
"about_this_log": {
"label": "About this log",
"subsections": {
"about_this_log": {
"label": "About this log",
"pages": {
"gdpr_acceptance": {
"header": "DLUHC Privacy Notice Acceptance",
"description": "",
"questions": {
"gdpr_acceptance": {
"check_answer_label": "GDPR acceptance",
"header": "Has the tenant or buyer seen the DLUHC privacy notice?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
}
}
},
"conditional_route_to": {
"organisation_details": { "gdpr_acceptance": "Yes" }
}
},
"gdpr_declined": {
"header": "You cannot use this service",
"hint_text": "",
"description": "We cannot accept data about a tenant or buyer unless they’ve seen the DLUHC privacy notice.",
"questions": {
}
},
"organisation_details": {
"header": "About this log",
"description": "Organisation Details",
"questions": {
"property_owner_organisation": {
"check_answer_label": "",
"header": "Which organisation owns this property?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "A",
"1": "B"
}
},
"property_manager_organisation": {
"check_answer_label": "",
"header": "Which organisation manages this property?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "A",
"1": "B"
}
}
}
},
"sale_or_letting": {
"header": "About this log",
"description": "Is this a sale or a letting?",
"questions": {
"sale_or_letting": {
"check_answer_label": "",
"header": "Is this a sale or a letting?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Sale",
"1": "Letting"
}
}
}
},
"tenant_same_property_renewal": {
"header": "About this log",
"description": "Is this a renewal to the same tenant in the same property?",
"questions": {
"tenant_same_property_renewal": {
"check_answer_label": "",
"header": "Is this a renewal to the same tenant in the same property?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
}
}
},
"depends_on": { "sale_or_letting": "Letting" }
},
"tenancy_start_date": {
"header": "About this log",
"description": "",
"questions": {
"tenancy_start_date": {
"check_answer_label": "When is the tenancy start date?",
"header": "What is the tenancy start date?",
"hint_text": "For example, 27 3 2007",
"type": "date"
}
},
"depends_on": { "sale_or_letting": "Letting" }
},
"letting_type": {
"header": "About this log",
"description": "",
"questions": {
"rent_type": {
"check_answer_label": "What is the rent type?",
"header": "What is the rent type?",
"hint_text": "",
"type": "select",
"answer_options": {
"0": "Social Rent",
"1": "Affordable Rent",
"2": "London Affordable Rent",
"3": "Rent To Buy",
"4": "London Living Rent",
"5": "Other Intermediate Rent Product"
},
"conditional_for": {
"intermediate_rent_product_name": ["Other Intermediate Rent Product"]
}
},
"intermediate_rent_product_name": {
"check_answer_label": "Enter the product name",
"header": "What is intermediate rent product name?",
"type": "text"
},
"needs_type": {
"check_answer_label": "What is the needs type?",
"header": "What is the needs type?",
"hint_text": "",
"type": "select",
"answer_options": {
"0": "Supported Housing",
"1": "General Needs"
}
}
},
"depends_on": { "sale_or_letting": "Letting" }
},
"sale_completion_date": {
"header": "About this log",
"description": "",
"questions": {
"sale_completion_date": {
"check_answer_label": "What is the sale completion date?",
"header": "What is the sale completion date?",
"hint_text": "For example, 27 3 2007",
"type": "date"
}
},
"depends_on": { "sale_or_letting": "Sale" }
},
"purchaser_code": {
"header": "About this log",
"description": "",
"questions": {
"purchaser_code": {
"check_answer_label": "What is the purchaser code?",
"header": "What is the purchaser code?",
"hint_text": "",
"type": "text"
}
},
"depends_on": { "sale_or_letting": "Sale" }
}
}
}
}
}
}
}
Loading…
Cancel
Save