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

PSR-1510 copy over of data from previous TY and clear out of details #927

Closed
wants to merge 4 commits into from

Conversation

cyeniceri
Copy link
Contributor

No description provided.

_ <- saveService.save(userAnswers.copy(id = UNCHANGED_SESSION_PREFIX + userAnswers.id))
_ <- saveService.save(userAnswers)
} yield {
Redirect(controllers.routes.WhatYouWillNeedController.onPageLoad(srn, "", taxYear, version))
Copy link
Contributor

@kberec kberec Oct 21, 2024

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?)

Copy link
Contributor Author

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 ?

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 it is ok If we can conditionally redirect and use this later on in the UI flow to distinguish pro-population.

Copy link
Contributor

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 .

Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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

…mberDetailsWithPageObject or prePopulateForMemberDetailsWithJsPath
@kberec kberec closed this Nov 5, 2024
@kberec
Copy link
Contributor

kberec commented Nov 5, 2024

@cyeniceri I'm closing as it is replaced by #946, please check if this was right

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