-
Notifications
You must be signed in to change notification settings - Fork 3
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
PSR-1510 copy over of data from previous TY and clear out of details #927
Conversation
_ <- saveService.save(userAnswers.copy(id = UNCHANGED_SESSION_PREFIX + userAnswers.id)) | ||
_ <- saveService.save(userAnswers) | ||
} yield { | ||
Redirect(controllers.routes.WhatYouWillNeedController.onPageLoad(srn, "", taxYear, 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.
We might need to conditionally redirect to a different URL here in case of pre-population. And maybe we need to use the same later on in the journey. Do we have the information that the pre-population has just happened? (maybe we can store that in the session?)
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.
We can understand it if lastSubmittedPsrFbInPreviousYears
is not None. That means we are going to read prepop data from etmp.
I separated the logic from SIPP. Do you think it is correct ?
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 think it is ok If we can conditionally redirect and use this later on in the UI flow to distinguish pro-population.
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.
We discussed with @cyeniceri and agreed to have a flag saved somewhere (e.g. request or mongo) to indicate that this return is a pre-population.
The value of this flag would be populated on "Start" and on "Continue" link too.
This value could be re-used later on for a conditional navigation and/or the task list/cya pages to dictate if this is a pre-population. FYI @westwater @ccatosdevelopment @narendrapaduchuri .
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.
Related: #930 (comment)
@@ -110,10 +112,28 @@ class OverviewController @Inject()( | |||
messages("site.continue") | |||
) | |||
} else { | |||
val lastSubmittedPsrFbInPreviousYears = | |||
versionsForYears | |||
.filter(x => LocalDate.parse(x.startDate) < yearFrom) |
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.
Would it be better to explicitly search for current tax year - 1 here? In that case the located data would be always from the previous year
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.
yeah but what happens if we have a gap year ? That's why I used this logic. I remember we asked this to Josh and he said this is not clear however the most recent submission must be used for the population. lastSubmittedPsrFbInPreviousYears logic must guarantee it.
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've asked this question again, let's see if this is more clear now from UX perspective.
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.
There is some ongoing discussion about this, we're going to keep this as is for now until that is resolved.
Could you please add a comment @cyeniceri so we can easily identify this later on, in case we need to changed it? E.g. something like \\ this logic assumes gap years are allowed in pre-population
…added to continue and start of outstanding journey
2f51eab
to
89d6579
Compare
…mberDetailsWithPageObject or prePopulateForMemberDetailsWithJsPath
@cyeniceri I'm closing as it is replaced by #946, please check if this was right |
No description provided.