Browse Source

Update routing and prevten inferrance (#1597)

pull/1518/head^2
kosiakkatrina 2 years ago committed by GitHub
parent
commit
9a4c912bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/models/derived_variables/lettings_log_variables.rb
  2. 2
      app/models/form/lettings/pages/referral.rb
  3. 2
      app/models/form/lettings/pages/referral_prp.rb
  4. 2
      app/models/form/lettings/pages/referral_supported_housing.rb
  5. 2
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  6. 4
      app/models/lettings_log.rb
  7. 8
      config/forms/2022_2023.json

4
app/models/derived_variables/lettings_log_variables.rb

@ -76,8 +76,8 @@ module DerivedVariables::LettingsLogVariables
self.voiddate = startdate self.voiddate = startdate
self.unitletas = form.start_date.year >= 2023 ? UNITLETAS_MAPPING_23_24[rent_type] : UNITLETAS_MAPPING[rent_type] self.unitletas = form.start_date.year >= 2023 ? UNITLETAS_MAPPING_23_24[rent_type] : UNITLETAS_MAPPING[rent_type]
if is_general_needs? if is_general_needs?
self.prevten = 32 if managing_organisation&.provider_type == "PRP" self.prevten = 32 if owning_organisation&.provider_type == "PRP"
self.prevten = 30 if managing_organisation&.provider_type == "LA" self.prevten = 30 if owning_organisation&.provider_type == "LA"
end end
end end

2
app/models/form/lettings/pages/referral.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral" @id = "referral"
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end end
def questions def questions

2
app/models/form/lettings/pages/referral_prp.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_prp" @id = "referral_prp"
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end end
def questions def questions

2
app/models/form/lettings/pages/referral_supported_housing.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing" @id = "referral_supported_housing"
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end end
def questions def questions

2
app/models/form/lettings/pages/referral_supported_housing_prp.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing_prp" @id = "referral_supported_housing_prp"
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
end end
def questions def questions

4
app/models/lettings_log.rb

@ -493,8 +493,8 @@ class LettingsLog < Log
update(unresolved: false) update(unresolved: false)
end end
def managing_organisation_provider_type def owning_organisation_provider_type
managing_organisation&.provider_type owning_organisation&.provider_type
end end
def reset_created_by! def reset_created_by!

8
config/forms/2022_2023.json

@ -7010,7 +7010,7 @@
}, },
"depends_on": [ "depends_on": [
{ {
"managing_organisation_provider_type": "LA", "owning_organisation_provider_type": "LA",
"needstype": 1, "needstype": 1,
"renewal": 0 "renewal": 0
} }
@ -7067,7 +7067,7 @@
}, },
"depends_on": [ "depends_on": [
{ {
"managing_organisation_provider_type": "PRP", "owning_organisation_provider_type": "PRP",
"needstype": 1, "needstype": 1,
"renewal": 0 "renewal": 0
} }
@ -7124,7 +7124,7 @@
}, },
"depends_on": [ "depends_on": [
{ {
"managing_organisation_provider_type": "LA", "owning_organisation_provider_type": "LA",
"needstype": 2, "needstype": 2,
"renewal": 0 "renewal": 0
} }
@ -7184,7 +7184,7 @@
}, },
"depends_on": [ "depends_on": [
{ {
"managing_organisation_provider_type": "PRP", "owning_organisation_provider_type": "PRP",
"needstype": 2, "needstype": 2,
"renewal": 0 "renewal": 0
} }

Loading…
Cancel
Save