Skip to content

Commit

Permalink
Merge 9c81dc1 into cfe35a0
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx authored Jan 16, 2025
2 parents cfe35a0 + 9c81dc1 commit 57ecd1a
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 2 deletions.
19 changes: 19 additions & 0 deletions internal/donor/donorpage/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,25 @@ func Progress(tmpl template.Template, lpaStoreResolvingService LpaStoreResolving
})
}

if donor.RegisteringWithCourtOfProtection {
if donor.Tasks.PayForLpa.IsCompleted() && !donor.WitnessedByCertificateProviderAt.IsZero() {
data.InfoNotifications = append(data.InfoNotifications, progressNotification{
Heading: appData.Localizer.T("yourLpaMustBeReviewedByCourtOfProtection"),
Body: appData.Localizer.T("opgIsCompletingChecksSoYouCanSubmitToCourtOfProtection"),
})
} else if donor.Tasks.PayForLpa.IsCompleted() {
data.InfoNotifications = append(data.InfoNotifications, progressNotification{
Heading: appData.Localizer.T("yourLpaMustBeReviewedByCourtOfProtection"),
Body: appData.Localizer.T("returnToYourTaskListToSignThenOpgWillCheck"),
})
} else if !donor.WitnessedByCertificateProviderAt.IsZero() {
data.InfoNotifications = append(data.InfoNotifications, progressNotification{
Heading: appData.Localizer.T("yourLpaMustBeReviewedByCourtOfProtection"),
Body: appData.Localizer.T("whenYouHavePaidOpgWillCheck"),
})
}
}

return tmpl(w, data)
}
}
56 changes: 56 additions & 0 deletions internal/donor/donorpage/progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,62 @@ func TestGetProgress(t *testing.T) {
return l
},
},
"applying to court of protection and signed and paid": {
donor: &donordata.Provided{
Tasks: donordata.Tasks{
PayForLpa: task.PaymentStateCompleted,
},
WitnessedByCertificateProviderAt: time.Now(),
RegisteringWithCourtOfProtection: true,
},
lpa: &lpadata.Lpa{},
setupCertificateProviderStore: certificateProviderStoreNotFound,
infoNotifications: []progressNotification{
{Heading: "H", Body: "B"},
},
setupLocalizer: func(t *testing.T) *mockLocalizer {
l := newMockLocalizer(t)
l.EXPECT().T("yourLpaMustBeReviewedByCourtOfProtection").Return("H")
l.EXPECT().T("opgIsCompletingChecksSoYouCanSubmitToCourtOfProtection").Return("B")
return l
},
},
"applying to court of protection and signed": {
donor: &donordata.Provided{
WitnessedByCertificateProviderAt: time.Now(),
RegisteringWithCourtOfProtection: true,
},
lpa: &lpadata.Lpa{},
setupCertificateProviderStore: certificateProviderStoreNotFound,
infoNotifications: []progressNotification{
{Heading: "H", Body: "B"},
},
setupLocalizer: func(t *testing.T) *mockLocalizer {
l := newMockLocalizer(t)
l.EXPECT().T("yourLpaMustBeReviewedByCourtOfProtection").Return("H")
l.EXPECT().T("whenYouHavePaidOpgWillCheck").Return("B")
return l
},
},
"applying to court of protection and paid": {
donor: &donordata.Provided{
Tasks: donordata.Tasks{
PayForLpa: task.PaymentStateCompleted,
},
RegisteringWithCourtOfProtection: true,
},
lpa: &lpadata.Lpa{},
setupCertificateProviderStore: certificateProviderStoreNotFound,
infoNotifications: []progressNotification{
{Heading: "H", Body: "B"},
},
setupLocalizer: func(t *testing.T) *mockLocalizer {
l := newMockLocalizer(t)
l.EXPECT().T("yourLpaMustBeReviewedByCourtOfProtection").Return("H")
l.EXPECT().T("returnToYourTaskListToSignThenOpgWillCheck").Return("B")
return l
},
},
}

for name, tc := range testCases {
Expand Down
6 changes: 5 additions & 1 deletion lang/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1519,5 +1519,9 @@
"voucherHasConfirmedYourIdentity": "{{.VoucherFullName}} Welsh",
"returnToYourTaskListForInformationAboutWhatToDoNext": "Welsh",
"weAreReviewingTheEvidenceYouSent": "Welsh",
"ifYourEvidenceIsApprovedWillShowPaid": "Welsh"
"ifYourEvidenceIsApprovedWillShowPaid": "Welsh",
"yourLpaMustBeReviewedByCourtOfProtection": "Welsh",
"opgIsCompletingChecksSoYouCanSubmitToCourtOfProtection": "Welsh",
"returnToYourTaskListToSignThenOpgWillCheck": "Welsh",
"whenYouHavePaidOpgWillCheck": "Welsh"
}
6 changes: 5 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1415,5 +1415,9 @@
"voucherHasConfirmedYourIdentity": "{{.VoucherFullName}} has confirmed your identity",
"returnToYourTaskListForInformationAboutWhatToDoNext": "Return to your task list for information about what to do next.",
"weAreReviewingTheEvidenceYouSent": "We are reviewing the evidence you sent about your LPA fee",
"ifYourEvidenceIsApprovedWillShowPaid": "If your evidence is approved, your LPA will show as paid."
"ifYourEvidenceIsApprovedWillShowPaid": "If your evidence is approved, your LPA will show as paid.",
"yourLpaMustBeReviewedByCourtOfProtection": "Your LPA must be reviewed by the Court of Protection",
"opgIsCompletingChecksSoYouCanSubmitToCourtOfProtection": "The Office of the Public Guardian is completing checks on your LPA so you can submit it to the Court of Protection. We’ll contact you with guidance on what to do next.",
"returnToYourTaskListToSignThenOpgWillCheck": "Return to your task list to sign your LPA. OPG will then be able to complete our checks on it so you can submit it to the Court of Protection.",
"whenYouHavePaidOpgWillCheck": "When you have paid for your LPA, the Office of the Public Guardian will complete our checks on it so you can submit it to the Court of Protection. We’ll contact you with guidance on what to do next."
}

0 comments on commit 57ecd1a

Please sign in to comment.