Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Dinssa
Copy link
Contributor

@Dinssa Dinssa commented Feb 25, 2025

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.

Copy link

Comment on lines +1 to +12
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
Copy link
Contributor Author

@Dinssa Dinssa Feb 26, 2025

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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

Comment on lines +11 to +35
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
Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Comment on lines +215 to +217
if referral_type_changed? && (referral_type_was == 7 || referral_type_was == 16)
self.referral = nil
end
Copy link
Collaborator

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?

Copy link
Collaborator

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
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants