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-775 - Allow journey to be completed by users in "Pending" LAs #250

Conversation

Glenn-Clarke
Copy link
Contributor

@Glenn-Clarke Glenn-Clarke commented Feb 12, 2024

THIS PR BUILDS UPON PC-776

Updated the user journey to allow those who select a "pending" status LA to continue their journey by acknowledging that they won't have their application processed at the current time, and not until the LA begins processing applications.

If the user acknowledges this, they are directed to the income check page, as if they had been part of an "active" LA.

image

image

image

…uthority is not particpating in sign ups through this service.
…ending LA's. Updated Pending page to add confirmation checkbox for user's understanding, with updated viewmodel and controller to reflect this.
…sed until the LA is active. Updated controller to reflect change of questions. Removed some duplicated text from the default partial.
@Glenn-Clarke Glenn-Clarke force-pushed the PC-775-Allow-journey-to-be-completed-by-users-in-Pending-LAs branch from 9f711d1 to a3063d4 Compare February 12, 2024 17:21
@Glenn-Clarke Glenn-Clarke requested a review from jdgage February 13, 2024 12:04
@Glenn-Clarke Glenn-Clarke changed the title PC 775 - Allow journey to be completed by users in "Pending" LAs PC-775 - Allow journey to be completed by users in "Pending" LAs Feb 13, 2024
@Glenn-Clarke Glenn-Clarke changed the base branch from develop to PC-776-Create-Customer-Journey-for-Non-Participation-LAs February 15, 2024 10:06
public bool isTrue => true;

[ModelBinder(typeof(GovUkCheckboxBoolBinder))]
[Compare("isTrue", ErrorMessage = "You must acknowledge that your application will not be processed until your local authority has signed up to use the service")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think something like

Suggested change
[Compare("isTrue", ErrorMessage = "You must acknowledge that your application will not be processed until your local authority has signed up to use the service")]
[Range(typeof(bool), "true", "true", ErrorMessage="...")]

might work? Which would save us the extra property. And if so then it might be nice to extract it to a custom attribute?

Otherwise let's use nameof(isTrue) to keep us robust to renames.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't realise you could use the Range validation attribute for booleans! It does seem to work when I've been testing it.
I've changed this over, but I can't figure out how to cleanly separate it into its own custom attribute.

Copy link
Contributor

Choose a reason for hiding this comment

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

The Range thing feels a bit weird to me. It's not very obvious what is going on.

I think you're better off just being explicit about the validation.

You can make the view model implement IValidatableObject:

public class PendingViewModel : QuestionFlowViewModel, IValidatableObject
{

then implement Validate() as follows:

public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
    if (!UserAcknowledgesApplicationNotProcessedUntilLocalAuthorityLive)
    {
        yield return new ValidationResult(
            "You must acknowledge that your application will not be processed until your local authority has signed up to use the service",
            new[] { nameof(UserAcknowledgesApplicationNotProcessedUntilLocalAuthorityLive) });
    }
}

Let me know if it would be useful to chat through what is going on here. 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Happy to jump on a call to go through it if you want! Don't think this needs to be a blocker though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though I've just seen Jamie's spoilers, I would be interested in also knowing how to implement it as a custom attribute!

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, we can chat about it tomorrow if you like

HerPublicWebsite/Models/Questionnaire/PendingViewModel.cs Outdated Show resolved Hide resolved
@Glenn-Clarke Glenn-Clarke force-pushed the PC-776-Create-Customer-Journey-for-Non-Participation-LAs branch from bf6a214 to e517f5f Compare February 19, 2024 09:48
…s' into PC-775-Allow-journey-to-be-completed-by-users-in-Pending-LAs

# Conflicts:
#	HerPublicWebsite.BusinessLogic/Services/QuestionFlow/QuestionFlowService.cs
#	HerPublicWebsite/Controllers/QuestionnaireController.cs
HerPublicWebsite/Models/Questionnaire/PendingViewModel.cs Outdated Show resolved Hide resolved
public bool isTrue => true;

[ModelBinder(typeof(GovUkCheckboxBoolBinder))]
[Compare("isTrue", ErrorMessage = "You must acknowledge that your application will not be processed until your local authority has signed up to use the service")]
Copy link
Contributor

Choose a reason for hiding this comment

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

The Range thing feels a bit weird to me. It's not very obvious what is going on.

I think you're better off just being explicit about the validation.

You can make the view model implement IValidatableObject:

public class PendingViewModel : QuestionFlowViewModel, IValidatableObject
{

then implement Validate() as follows:

public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
    if (!UserAcknowledgesApplicationNotProcessedUntilLocalAuthorityLive)
    {
        yield return new ValidationResult(
            "You must acknowledge that your application will not be processed until your local authority has signed up to use the service",
            new[] { nameof(UserAcknowledgesApplicationNotProcessedUntilLocalAuthorityLive) });
    }
}

Let me know if it would be useful to chat through what is going on here. 🙂

HerPublicWebsite/Models/Questionnaire/PendingViewModel.cs Outdated Show resolved Hide resolved
HerPublicWebsite/Views/Questionnaire/Pending.cshtml Outdated Show resolved Hide resolved
HerPublicWebsite/Views/Questionnaire/Pending.cshtml Outdated Show resolved Hide resolved
HerPublicWebsite/Views/Questionnaire/Pending.cshtml Outdated Show resolved Hide resolved
HerPublicWebsite/Views/Questionnaire/Pending.cshtml Outdated Show resolved Hide resolved
…s' into PC-775-Allow-journey-to-be-completed-by-users-in-Pending-LAs
@@ -357,7 +357,7 @@ private QuestionFlowStep NotParticipatingForwardDestination(Questionnaire questi

private QuestionFlowStep PendingForwardDestination(Questionnaire questionnaire)
{
return QuestionFlowStep.Pending;
return QuestionFlowStep.HouseholdIncome;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ I don't think that this flow is always correct.

SelectAddressForwardDestination() (which is the point we should be picking up from) has the following options for next steps:

else if (questionnaire.FoundEpcBandIsTooHigh)
{
    return QuestionFlowStep.ReviewEpc;
}
// If the LA has changed and the income band the user selected previously is no longer valid then we don't
// go back to the check your answers page as the user will need to select a new income band.
else if (entryPoint is QuestionFlowStep.Address && questionnaire.IncomeBandIsValid)
{
    return QuestionFlowStep.CheckAnswers;
}

return QuestionFlowStep.HouseholdIncome;

I think we need to clarify with DESNZ what we should be doing if we should be showing the ReviewEpc step.

I would expect that we should show that in preference to the Pending page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I've moved the ReviewEPC check so it catches people before they're caught by the Pending check :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Glenn-Clarke. That being the case, we need to also change the options in ReviewEpcForwardDestination() to potentially forward you to Pending.

Base automatically changed from PC-776-Create-Customer-Journey-for-Non-Participation-LAs to develop February 20, 2024 09:10
…ing page to allow for EPC first, and back flow from following page. Fixed formatting in Pending. Fixing merge issue.
Copy link
Contributor

@jamiehumphries jamiehumphries left a comment

Choose a reason for hiding this comment

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

This is all looking good for the most part, however I think there are still some complications around the question flow.

I've added comments, but let me know if it would be easier to chat them through as it is quite nitty-gritty.

@@ -357,7 +357,7 @@ private QuestionFlowStep NotParticipatingForwardDestination(Questionnaire questi

private QuestionFlowStep PendingForwardDestination(Questionnaire questionnaire)
{
return QuestionFlowStep.Pending;
return QuestionFlowStep.HouseholdIncome;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Glenn-Clarke. That being the case, we need to also change the options in ReviewEpcForwardDestination() to potentially forward you to Pending.

…sit address/EPC, and also when a new address is chosen with a different LA status.
…estionnaire, so the box stays filled if the user returns. It is emptied if the user changes their address or LA.
@Glenn-Clarke
Copy link
Contributor Author

Just pushing before end of day, still need to check it over tomorrow morning to fix issues

@jamiehumphries jamiehumphries merged commit 612c7f1 into develop Feb 25, 2024
1 check passed
@jamiehumphries jamiehumphries deleted the PC-775-Allow-journey-to-be-completed-by-users-in-Pending-LAs branch February 25, 2024 15:07
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.

3 participants