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

PC-577: add solar pv question #312

Merged
merged 8 commits into from
Dec 2, 2024
Merged

Conversation

Glenn-Clarke
Copy link
Collaborator

@Glenn-Clarke Glenn-Clarke commented Nov 27, 2024

Link to Jira ticket

Description

Adding the Solar PV question to the journey & adding the response to the BRE API request.

Checklist

  • I have made any necessary updates to the documentation
  • I have checked there are no unnecessary IDE warnings in this PR
  • I have checked there are no unintentional line ending changes
  • I have added tests where applicable
  • If I have made any changes to the code, I have used the IDE auto-formatter on it
  • If I have made any changes to website flow, I have updated the Flow Miro Board
  • If I have made any changes to website flow, I have checked forward and back behaviour is still consistent
  • If I have made any changes to content strings or resource files, I have followed the documentation

Screenshots

@Glenn-Clarke Glenn-Clarke marked this pull request as ready for review November 28, 2024 14:09
@Glenn-Clarke
Copy link
Collaborator Author

Will do Miro Changes soon, and tick the box when done.

{
SolarElectricPanels.Yes => true,
SolarElectricPanels.No => false,
SolarElectricPanels.DoNotKnow => null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SolarElectricPanels.DoNotKnow => null,
SolarElectricPanels.DoNotKnow => false,

We should be sending false if the user answers "I don't know": doesn't look like that's happening at the moment? Looks like this is the place for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null and False lead to the same outcome with the API. I've left it this way because I think when we get the hint data, we want to override the user's option on a "don't know" with the open EPC information.

At least that was my understanding of the documents on the ticket.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow: I can see their change doc has it as a non-nullable boolean, and I'm looking at the requirements:

User response will be used to populate a pv_panel field in the
This is a boolean true or false field (see API document below)
If the user answers “Yes”, we send true
If the user answers “No” or “I don’t know” , we send false
It should be added to the BreRequest object that is sent in the BRE recommendation request (see BreApi class)

It could be worth double checking with BRE what they're expecting from us here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! No that's fair, I'll change it over. I was looking at the attached document's open epc thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change has been made. left a fallback 'null' in the case of no solar pv answer

Comment on lines 682 to 685
if (entryPoint is not null)
{
return QuestionFlowStep.AnswerSummary;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean has happened? User's changing their answers? Can that be made any clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Yes, the user is going back to edit
  • I've missed some logic here, for the roof construction question
  • I've also just realised I've made a mistake with this question placement, because of that. The question before this has follow-on questions (loft questions), and because of the way routing works on FWTS, it will always push the user through the Solar Panels question again to answer the loft questions if they go back and change their answer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I interpreted the ticket as "directly after" the roof construction question, not just after, which was my mistake.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spoke with glenn yesterday, we agreed to move the solar pv question to the end of the roof questions flow, which makes the most sense. its also GDS compliant, since putting a non conditional question between conditional ones can cause issues with the change page asking questions it doesnt need to

migrationBuilder.AddColumn<int>(
name: "SolarElectricPanels",
table: "PropertyData",
type: "integer",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integer is a bit of a surprise? Why's that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the underlying type for the enum, the index of the value.
From PropertyData.cs:
public SolarElectricPanels? SolarElectricPanels { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right it's an enum, yes

if user was midway through form when updated released, for instance. stops summary page crash
as requested on ticket. leave a null option in the case of no solar pv option (previous behaviour)
@samyou-softwire samyou-softwire force-pushed the PC-577-Add-Solar-PV-question branch from 1000c41 to c1eefd1 Compare November 29, 2024 11:03
jdgage
jdgage previously approved these changes Nov 29, 2024
Copy link
Contributor

@jdgage jdgage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine apart from that one file, can merge once that's sorted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we want these (should probably be gitignored)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have gitignored these now

@samyou-softwire
Copy link
Contributor

Will do Miro Changes soon, and tick the box when done.

this has now been done

@Glenn-Clarke Glenn-Clarke merged commit 347025b into dev Dec 2, 2024
3 checks passed
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.

4 participants