-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLDC-3843: Lettings household situation change Q84 question format #2958
base: main
Are you sure you want to change the base?
CLDC-3843: Lettings household situation change Q84 question format #2958
Conversation
Created review app at https://review.submit-social-housing-data.communities.gov.uk/2958 |
class Form::Lettings::Pages::ReferralGeneralNeeds < ::Form::Page | ||
def initialize(id, hsh, subsection) | ||
super | ||
@id = "referral_prp" | ||
@copy_key = "lettings.household_situation.referral.general_needs.prp" | ||
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }] | ||
end | ||
|
||
def questions | ||
@questions ||= [Form::Lettings::Questions::ReferralGeneralNeeds.new(nil, nil, self)] | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed the old 2024 referral_prp
page & question to referral_general_needs
to reuse the name for the new 2025 version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the other referral is also used for general needs? Maybe ReferralGeneralNeedsPrp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will change it to that
def answer_options | ||
{ | ||
"101" => { | ||
"value" => "Direct", | ||
}, | ||
"102" => { | ||
"value" => "From a local authority housing register or waiting list", | ||
}, | ||
"103" => { | ||
"value" => "From a PRP-only housing register or waiting list (no local authority involvement)", | ||
}, | ||
"104" => { | ||
"value" => "Health and social care services", | ||
}, | ||
"105" => { | ||
"value" => "Police, probation, prison or youth offending team", | ||
}, | ||
"7" => { | ||
"value" => "Voluntary agency", | ||
}, | ||
"16" => { | ||
"value" => "Other", | ||
}, | ||
}.freeze | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values 101-5 are intermediary values stored in referral_type to show the right sub page. I chose to start from 100 to throw the numbering well away from the numbers we'd expect for each referral type.
7 & 16 are the actual numbers for each of those referral types, which do not have a sub page. It will be assigned to the referral attribute when in our derived variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does referral type has to directly map onto referral?
Is there benefits/drawbacks to have these numbered independently (for example 1 - 7) and map when we're setting the referral where relevant?
if referral_type_changed? && (referral_type_was == 7 || referral_type_was == 16) | ||
self.referral = nil | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if it changed from 7 to 16? Can it be cleared by routing rules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test for this?
@@ -0,0 +1,105 @@ | |||
class Form::Lettings::Questions::ReferralGeneralNeeds < ::Form::Question |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is also just a rename?
This PR updates the formatting of Q84 (“What was the source of referral for this letting?”). The new format presents a consistent question to all users, categorises referral reasons, and directs users to a relevant sub-question for further specification. This replaces the previous format, which displayed a single page with a long list of referral reasons that varied based on previous answers. The new format aligns more closely with the paper form.