Browse Source

feat: add void date guidance partial

pull/1440/head
natdeanlewissoftwire 3 years ago
parent
commit
c921420770
  1. 4
      app/models/form/lettings/pages/void_date.rb
  2. 6
      app/models/form/lettings/questions/voiddate.rb
  3. 2
      app/models/form/lettings/subsections/property_information.rb
  4. 6
      app/services/bulk_upload/lettings/year2022/row_parser.rb
  5. 9
      app/views/form/guidance/_void_date.html.erb
  6. 9
      config/forms/2022_2023.json
  7. 2
      spec/models/form/lettings/subsections/property_information_spec.rb

4
app/models/form/lettings/pages/void_or_renewal_date.rb → app/models/form/lettings/pages/void_date.rb

@ -1,7 +1,7 @@
class Form::Lettings::Pages::VoidOrRenewalDate < ::Form::Page
class Form::Lettings::Pages::VoidDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "void_or_renewal_date"
@id = "void_date"
@depends_on = [
{ "renewal" => 0, "rsnvac" => 5 },
{ "renewal" => 0, "rsnvac" => 6 },

6
app/models/form/lettings/questions/voiddate.rb

@ -2,10 +2,12 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "voiddate"
@check_answer_label = "Void or renewal date"
@header = "What is the void or renewal date?"
@check_answer_label = "Void date"
@header = "What is the void date?"
@type = "date"
@check_answers_card_number = 0
@question_number = 23
@guidance_partial = "void_date"
@guidance_position = GuidancePosition::BOTTOM
end
end

2
app/models/form/lettings/subsections/property_information.rb

@ -20,7 +20,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self),
Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self),
Form::Lettings::Pages::VoidOrRenewalDate.new(nil, nil, self),
Form::Lettings::Pages::VoidDate.new(nil, nil, self),
Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self),
Form::Lettings::Pages::NewBuildHandoverDate.new(nil, nil, self),
Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self),

6
app/services/bulk_upload/lettings/year2022/row_parser.rb

@ -91,9 +91,9 @@ class BulkUpload::Lettings::Year2022::RowParser
field_86: "Does the household pay rent or other charges for the accommodation?",
field_87: "After the household has received any housing-related benefits, will they still need to pay basic rent and other charges?",
field_88: "What do you expect the outstanding amount to be?",
field_89: "What is the void or renewal date?",
field_90: "What is the void or renewal date?",
field_91: "What is the void or renewal date?",
field_89: "What is the void date?",
field_90: "What is the void date?",
field_91: "What is the void date?",
field_92: "What date were major repairs completed on?",
field_93: "What date were major repairs completed on?",
field_94: "What date were major repairs completed on?",

9
app/views/form/guidance/_void_date.html.erb

@ -0,0 +1,9 @@
<%= govuk_details(summary_text: "What is a void date?") do %>
<p class="govuk-body">Date the property was (legally or contractually) available to let, or for:</p>
<ul class="govuk-list govuk-list--bullet">
<li>re-lets: the day after the previous tenant's contract ended</li>
<li>new builds: the day the landlord legally first owned the property (‘completion date’)</li>
<li>new conversions or acquisitions: completion date, or the day after rehabilitation work ended</li>
<li>new leases: the day the landlord got contractual property rights and could let it out to tenants</li>
</ul>
<% end %>

9
config/forms/2022_2023.json

@ -714,15 +714,16 @@
}
]
},
"void_or_renewal_date": {
"void_date": {
"header": "",
"description": "",
"questions": {
"voiddate": {
"check_answer_label": "Void or renewal date",
"header": "What is the void or renewal date?",
"check_answer_label": "Void date",
"header": "What is the void date?",
"hint_text": "For example, 27 3 2021.",
"type": "date"
"type": "date",
"guidance_partial": "void_date"
}
},
"depends_on": [

2
spec/models/form/lettings/subsections/property_information_spec.rb

@ -26,7 +26,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do
property_building_type
property_wheelchair_accessible
property_number_of_bedrooms
void_or_renewal_date
void_date
void_date_value_check
new_build_handover_date
property_major_repairs

Loading…
Cancel
Save