From 41a170a794670aeb3d7567906da78ec844a61f95 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Mon, 22 May 2023 14:22:39 +0100 Subject: [PATCH] feat: ensure period is routed to for needstype 1 regardless of household_charge (#1647) --- app/models/form/lettings/pages/rent_period.rb | 2 +- config/forms/2022_2023.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/form/lettings/pages/rent_period.rb b/app/models/form/lettings/pages/rent_period.rb index da121a305..c075e7a5c 100644 --- a/app/models/form/lettings/pages/rent_period.rb +++ b/app/models/form/lettings/pages/rent_period.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentPeriod < ::Form::Page def initialize(id, hsh, subsection) super @id = "rent_period" - @depends_on = [{ "household_charge" => 0 }, { "household_charge" => nil }] + @depends_on = [{ "needstype" => 1 }, { "needstype" => 2, "household_charge" => 0 }, { "needstype" => 2, "household_charge" => nil }] end def questions diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 161101e4f..dbfed6b4a 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -7481,9 +7481,14 @@ }, "depends_on": [ { + "needstype": 1 + }, + { + "needstype": 2, "household_charge": 0 }, { + "needstype": 2, "household_charge": null } ]