Skip to content

Commit

Permalink
MLPAB-2408 Merge branch 'main' into MLPAB-2408-run-scheduled-events
Browse files Browse the repository at this point in the history
  • Loading branch information
acsauk committed Oct 16, 2024
2 parents d82d538 + d3f3f5f commit 818938e
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 44 deletions.
17 changes: 15 additions & 2 deletions internal/donor/donordata/provided.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,21 @@ func (p *Provided) DonorIdentityConfirmed() bool {
p.IdentityUserData.DateOfBirth.Equals(p.Donor.DateOfBirth)
}

func (p *Provided) AttorneysAndCpSigningDeadline() time.Time {
return p.SignedAt.Add((24 * time.Hour) * 28)
// SigningDeadline gives the date at which the LPA should be signed by the
// certificate provider and attorneys.
func (p *Provided) SigningDeadline() time.Time {
if p.RegisteringWithCourtOfProtection {
return p.SignedAt.AddDate(0, 4, 14)
}

return p.SignedAt.AddDate(0, 0, 28)
}

// CourtOfProtectionSubmissionDeadline gives the date at which the signed LPA
// must be submitted to the Court of Protection, if registering through this
// route.
func (p *Provided) CourtOfProtectionSubmissionDeadline() time.Time {
return p.SignedAt.AddDate(0, 6, 0)
}

type Under18ActorDetails struct {
Expand Down
17 changes: 15 additions & 2 deletions internal/donor/donordata/provided_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,26 @@ func TestIdentityConfirmed(t *testing.T) {
}
}

func TestAttorneysSigningDeadline(t *testing.T) {
func TestSigningDeadline(t *testing.T) {
donor := Provided{
SignedAt: time.Date(2020, time.January, 2, 3, 4, 5, 6, time.UTC),
}

expected := time.Date(2020, time.January, 30, 3, 4, 5, 6, time.UTC)
assert.Equal(t, expected, donor.AttorneysAndCpSigningDeadline())
assert.Equal(t, expected, donor.SigningDeadline())

donor.RegisteringWithCourtOfProtection = true
expected = time.Date(2020, time.May, 16, 3, 4, 5, 6, time.UTC)
assert.Equal(t, expected, donor.SigningDeadline())
}

func TestCourtOfProtectionSubmissionDeadline(t *testing.T) {
donor := Provided{
SignedAt: time.Date(2020, time.January, 2, 3, 4, 5, 6, time.UTC),
}

expected := time.Date(2020, time.July, 2, 3, 4, 5, 6, time.UTC)
assert.Equal(t, expected, donor.CourtOfProtectionSubmissionDeadline())
}

func TestUnder18ActorDetails(t *testing.T) {
Expand Down
24 changes: 17 additions & 7 deletions lang/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@
"submittedYourLpa": "Rydych wedi cyflwyno eich LPA",
"whatHappensNext": "Beth fydd yn digwydd nesaf",
"weWillContactYourCertificateProvider": "Byddwn yn cysylltu â’ch darparwr tystysgrif, {{.FirstNames}}, ac yn gofyn iddynt gadarnhau eu hunaniaeth.",
"yourCertificateProviderWillThenNeedTo": "Yna bydd angen i’ch darparwr tystysgrif ‘ddarparu’r dystysgrif’ drwy lofnodi ar-lein.",
"weWillThenContactAttorneys": {
"one": "Yna byddwn yn cysylltu â {{.FullNames}} ac yn gofyn iddynt lofnodi eich LPA fel eich atwrnai.",
"two": "Yna byddwn yn cysylltu â {{.FullNames}} ac yn gofyn iddynt lofnodi eich LPA fel eich atwrneiod.",
Expand All @@ -307,13 +306,22 @@
},
"onceEveryoneHasSigned": "Unwaith y bydd pawb wedi llofnodi a phan fydd eich LPA wedi’n cyrraedd, byddwn yn hysbysu unrhyw bobl y byddwch yn dewis rhoi gwybod iddynt. Bydd cyfnod aros o 4 wythnos yn dechrau. Mae hyn yn ofynnol yn ôl y gyfraith, er mwyn caniatáu i unrhyw un sydd â gwrthwynebiad i’w codi.",
"wellRegisteredYourLpa": "Byddwn yn cofrestru eich LPA.",
"atTheEndOfTheWaitingPeriod": "Welsh",
"ifYourLpaIsSuccessfullyReviewed": "Welsh",
"weWillEmailYou": "<p class=\"govuk-body\">Byddwn yn anfon e-bost atoch i roi’r wybodaeth ddiweddaraf i chi am gofrestriad eich LPA. Os oes unrhyw broblemau, byddwn yn rhoi gwybod i chi.</p><p class=\"govuk-body\">Gallwch hefyd gadw golwg ar gynnydd eich LPA drwy fewngofnodi i’r gwasanaeth hwn unrhyw bryd.</p>",
"signIn4WeeksWarning": {
"one": "Rhaid i {{ .CpFirstNames }} a’ch atwrnai lofnodi’r LPA erbyn {{ .AttorneysAndCpSigningDeadline }}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{ .CpFirstNames }} a llofnodi’ch LPA eto.",
"two": "Rhaid i {{ .CpFirstNames }} a’ch atwrneiod lofnodi’r LPA erbyn {{ .AttorneysAndCpSigningDeadline }}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{ .CpFirstNames }} a llofnodi’ch LPA eto.",
"few": "Rhaid i {{ .CpFirstNames }} a’ch atwrneiod lofnodi’r LPA erbyn {{ .AttorneysAndCpSigningDeadline }}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{ .CpFirstNames }} a llofnodi’ch LPA eto.",
"many": "Rhaid i {{ .CpFirstNames }} a’ch atwrneiod lofnodi’r LPA erbyn {{ .AttorneysAndCpSigningDeadline }}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{ .CpFirstNames }} a llofnodi’ch LPA eto.",
"other": "Rhaid i {{ .CpFirstNames }} a’ch atwrneiod lofnodi’r LPA erbyn {{ .AttorneysAndCpSigningDeadline }}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{ .CpFirstNames }} a llofnodi’ch LPA eto."
"one": "Rhaid i {{.CertificateProviderFirstNames}} a’ch atwrnai lofnodi’r LPA erbyn {{.SigningDeadline}}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{.CertificateProviderFirstNames}} a llofnodi’ch LPA eto.",
"two": "Rhaid i {{.CertificateProviderFirstNames}} a’ch atwrneiod lofnodi’r LPA erbyn {{.SigningDeadline}}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{.CertificateProviderFirstNames}} a llofnodi’ch LPA eto.",
"few": "Rhaid i {{.CertificateProviderFirstNames}} a’ch atwrneiod lofnodi’r LPA erbyn {{.SigningDeadline}}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{.CertificateProviderFirstNames}} a llofnodi’ch LPA eto.",
"many": "Rhaid i {{.CertificateProviderFirstNames}} a’ch atwrneiod lofnodi’r LPA erbyn {{.SigningDeadline}}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{.CertificateProviderFirstNames}} a llofnodi’ch LPA eto.",
"other": "Rhaid i {{.CertificateProviderFirstNames}} a’ch atwrneiod lofnodi’r LPA erbyn {{.SigningDeadline}}. Os na fyddant yn llofnodi erbyn y dyddiad hwn, bydd yn rhaid i chi gwrdd â {{.CertificateProviderFirstNames}} a llofnodi’ch LPA eto."
},
"copSignDeadlineWarning": {
"one": "Welsh {{.CertificateProviderFirstNames}} {{.SigningDeadline}}",
"two": "Welsh {{.CertificateProviderFirstNames}} {{.SigningDeadline}}",
"few": "Welsh {{.CertificateProviderFirstNames}} {{.SigningDeadline}}",
"many": "Welsh {{.CertificateProviderFirstNames}} {{.SigningDeadline}}",
"other": "Welsh {{.CertificateProviderFirstNames}} {{.SigningDeadline}}"
},
"signYourLpa": "Llofnodwch eich LPA",
"signingYourLpaIsAnImportant": "Mae llofnodi eich LPA yn gam cyfreithiol pwysig a phwerus.",
Expand Down Expand Up @@ -1412,5 +1420,7 @@
"defaultDecisionHasBeenSelected": "Welsh",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:donor": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">Welsh</h2><p class=\"govuk-body\">Welsh</p></div>",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:certificate-provider": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">Welsh</h2><p class=\"govuk-body\">Welsh {{possessive .DonorFullName }} Welsh</p></div>",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:voucher": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">Welsh</h2><p class=\"govuk-body\">Welsh</p></div>"
"youHaveSuccessfullyConfirmedYourIdentitySuccess:voucher": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">Welsh</h2><p class=\"govuk-body\">Welsh</p></div>",
"thanksWeCannotRegisterUntilCourtOfProtection": "Welsh",
"youCanTrackTheProgressByLoggingBackIn": "Welsh"
}
21 changes: 14 additions & 7 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,23 @@
"theCodeWeSentCertificateProvider": "The code we sent to the certificate provider",
"submittedYourLpa": "You’ve submitted your LPA",
"whatHappensNext": "What happens next",
"weWillContactYourCertificateProvider": "We’ll contact your certificate provider, {{.FirstNames}}, and ask them to confirm their identity.",
"yourCertificateProviderWillThenNeedTo": "Your certificate provider will then need to ‘provide the certificate’ by signing online.",
"weWillContactYourCertificateProvider": "We’ll contact {{.FirstNames}} and ask them to confirm their identity and provide the certificate for your LPA.",
"weWillThenContactAttorneys": {
"one": "We will then contact {{.FullNames}} and ask them to sign your LPA as your attorney.",
"other": "We will then contact {{.FullNames}} and ask them to sign your LPA as your attorneys."
"one": "We’ll contact {{.FullNames}} and ask them to sign your LPA as your attorney.",
"other": "We’ll contact {{.FullNames}} and ask them to sign your LPA as your attorneys."
},
"onceEveryoneHasSigned": "Once everyone has signed and we’ve received your LPA, we’ll inform any people you chose to notify. A 4-week waiting period will begin. This is required by law, to allow anyone with objections to raise them.",
"wellRegisteredYourLpa": "We’ll register your LPA.",
"atTheEndOfTheWaitingPeriod": "At the end of the waiting period, we’ll contact you with guidance about getting your LPA reviewed by the Court of Protection.",
"ifYourLpaIsSuccessfullyReviewed": "If your LPA is successfully reviewed by the Court of Protection, we’ll be able to register it, and it can then be used.",
"weWillEmailYou": "<p class=\"govuk-body\">We’ll email you to update you with the progress of your LPA’s registration. If there are any problems, we’ll let you know.</p><p class=\"govuk-body\">You can also track the progress of your LPA by logging back into this service at any time.</p>",
"signIn4WeeksWarning": {
"one": "{{ .CpFirstNames }} and your attorney must sign your LPA by {{ .AttorneysAndCpSigningDeadline }}. If they do not sign by this date, you will have to pay the application fee again. You will also have to meet with {{ .CpFirstNames }} and sign your LPA again. ",
"other": "{{ .CpFirstNames }} and your attorneys must sign your LPA by {{ .AttorneysAndCpSigningDeadline }}. If they do not sign by this date, you will have to pay the application fee again. You will also have to meet with {{ .CpFirstNames }} and sign your LPA again. "
"one": "{{.CertificateProviderFirstNames}} and your attorney must sign your LPA by {{.SigningDeadline}}. If they do not sign by this date, you will have to pay the application fee again. You will also have to meet with {{.CertificateProviderFirstNames}} and sign your LPA again.",
"other": "{{.CertificateProviderFirstNames}} and your attorneys must sign your LPA by {{.SigningDeadline}}. If they do not sign by this date, you will have to pay the application fee again. You will also have to meet with {{.CertificateProviderFirstNames}} and sign your LPA again."
},
"copSignDeadlineWarning": {
"one": "{{.CertificateProviderFirstNames}} and your attorney must sign your LPA by {{.SigningDeadline}}. After that, you have until {{.SubmissionDeadline}} to submit the LPA to the Court of Protection. If you miss this deadline, you’ll have to fill in a new LPA and pay another registration fee.",
"other": "{{.CertificateProviderFirstNames}} and your attorneys must sign your LPA by {{.SigningDeadline}}. After that, you have until {{.SubmissionDeadline}} to submit the LPA to the Court of Protection. If you miss this deadline, you’ll have to fill in a new LPA and pay another registration fee."
},
"myLastingPowersOfAttorney": "My lasting powers of attorney",
"applicationNumber": "Application number",
Expand Down Expand Up @@ -1341,5 +1346,7 @@
"defaultDecisionHasBeenSelected": "A default decision has been selected for you because your answer was missing or your intention unclear.",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:donor": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">You have successfully confirmed your identity</h2><p class=\"govuk-body\">Thank you for confirming your identity using GOV.UK One Login. Your details match those you entered in your LPA.</p></div>",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:certificate-provider": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">You have successfully confirmed your identity</h2><p class=\"govuk-body\">Thank you for confirming your identity using GOV.UK One Login. Your details match those entered in {{possessive .DonorFullName }} LPA.</p></div>",
"youHaveSuccessfullyConfirmedYourIdentitySuccess:voucher": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">You have successfully confirmed your identity</h2><p class=\"govuk-body\">Thank you for confirming your identity using GOV.UK One Login.</p></div>"
"youHaveSuccessfullyConfirmedYourIdentitySuccess:voucher": "<div class=\"govuk-notification-banner__content\"><h2 class=\"govuk-notification-banner__heading\">You have successfully confirmed your identity</h2><p class=\"govuk-body\">Thank you for confirming your identity using GOV.UK One Login.</p></div>",
"thanksWeCannotRegisterUntilCourtOfProtection": "Thanks for signing and submitting your LPA. We cannot register your LPA until it has been successfully reviewed by the Court of Protection.",
"youCanTrackTheProgressByLoggingBackIn": "You can track the progress of your LPA by logging back into the service at any time."
}
71 changes: 45 additions & 26 deletions web/template/donor/you_have_submitted_your_lpa.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,50 @@
{{ define "pageTitle" }}{{ tr .App "submittedYourLpa" }}{{ end }}

{{ define "main" }}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">{{ tr .App "submittedYourLpa" }}</h1>
</div>

<h2 class="govuk-heading-m">{{ tr .App "whatHappensNext" }}</h2>

<ol class="govuk-list govuk-list--number govuk-list--spaced">
<li>{{ trFormat .App "weWillContactYourCertificateProvider" "FirstNames" .Donor.CertificateProvider.FirstNames }}</li>
<li>{{ tr .App "yourCertificateProviderWillThenNeedTo" }}</li>
<li>{{ trFormatCount .App "weWillThenContactAttorneys" .Donor.Attorneys.Len "FullNames" (concatAnd .App .Donor.Attorneys.FullNames) }}</li>
<li>{{ tr .App "onceEveryoneHasSigned" }}</li>
<li>{{ tr .App "wellRegisteredYourLpa" }}</li>
</ol>

{{ trHtml .App "weWillEmailYou" }}

{{ $formattedDeadline := formatDate .App .Donor.AttorneysAndCpSigningDeadline}}
{{ $signIn4WeeksWarning := trFormatCount .App "signIn4WeeksWarning" .Donor.Attorneys.Len "CpFirstNames" .Donor.CertificateProvider.FirstNames "AttorneysAndCpSigningDeadline" $formattedDeadline}}
{{ template "warning" (content .App $signIn4WeeksWarning) }}

<a class="govuk-button" href="{{ link .App global.Paths.Dashboard.Format }}" data-module="govuk-button">
{{ tr .App "continue" }}
</a>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">{{ tr .App "submittedYourLpa" }}</h1>
</div>

<h2 class="govuk-heading-m">{{ tr .App "whatHappensNext" }}</h2>

{{ if .Donor.RegisteringWithCourtOfProtection }}
<p class="govuk-body">{{ tr .App "thanksWeCannotRegisterUntilCourtOfProtection" }}</p>

<ol class="govuk-list govuk-list--number govuk-list--spaced">
<li>{{ trFormat .App "weWillContactYourCertificateProvider" "FirstNames" .Donor.CertificateProvider.FirstNames }}</li>
<li>{{ trFormatCount .App "weWillThenContactAttorneys" .Donor.Attorneys.Len "FullNames" (concatAnd .App .Donor.Attorneys.FullNames) }}</li>
<li>{{ tr .App "onceEveryoneHasSigned" }}</li>
<li>{{ tr .App "atTheEndOfTheWaitingPeriod" }}</li>
<li>{{ tr .App "ifYourLpaIsSuccessfullyReviewed" }}</li>
</ol>

<p class="govuk-body">{{ tr .App "youCanTrackTheProgressByLoggingBackIn" }}</p>

{{ template "warning" (content .App (trFormatCount .App "copSignDeadlineWarning" .Donor.Attorneys.Len
"CertificateProviderFirstNames" .Donor.CertificateProvider.FirstNames
"SigningDeadline" (formatDate .App .Donor.SigningDeadline)
"SubmissionDeadline" (formatDate .App .Donor.CourtOfProtectionSubmissionDeadline))) }}

{{ else }}
<ol class="govuk-list govuk-list--number govuk-list--spaced">
<li>{{ trFormat .App "weWillContactYourCertificateProvider" "FirstNames" .Donor.CertificateProvider.FirstNames }}</li>
<li>{{ trFormatCount .App "weWillThenContactAttorneys" .Donor.Attorneys.Len "FullNames" (concatAnd .App .Donor.Attorneys.FullNames) }}</li>
<li>{{ tr .App "onceEveryoneHasSigned" }}</li>
<li>{{ tr .App "wellRegisteredYourLpa" }}</li>
</ol>

{{ trHtml .App "weWillEmailYou" }}

{{ template "warning" (content .App (trFormatCount .App "signIn4WeeksWarning" .Donor.Attorneys.Len
"CertificateProviderFirstNames" .Donor.CertificateProvider.FirstNames
"SigningDeadline" (formatDate .App .Donor.SigningDeadline))) }}
{{ end }}

<a class="govuk-button" href="{{ link .App global.Paths.Dashboard.Format }}" data-module="govuk-button">
{{ tr .App "continue" }}
</a>
</div>
</div>
</div>
{{ end }}

0 comments on commit 818938e

Please sign in to comment.