diff --git a/cmd/mlpa/main.go b/cmd/mlpa/main.go index 0bffbf0cc7..3ebac95e83 100644 --- a/cmd/mlpa/main.go +++ b/cmd/mlpa/main.go @@ -145,7 +145,7 @@ func run(ctx context.Context, logger *slog.Logger) error { if metadataURL != "" { region, err = awsRegion(metadataURL) if err != nil { - logger.Warn("error getting region:", err) + logger.Warn("error getting region:", slog.Any("err", err)) } } diff --git a/go.mod b/go.mod index a187db85fe..b02a406bda 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ministryofjustice/opg-modernising-lpa -go 1.22.5 +go 1.23.0 require ( github.com/MicahParks/jwkset v0.5.18 diff --git a/internal/lpastore/lpa.go b/internal/lpastore/lpa.go index f005151f0e..8c4d3002b2 100644 --- a/internal/lpastore/lpa.go +++ b/internal/lpastore/lpa.go @@ -9,6 +9,7 @@ import ( "net/http" "time" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" "github.com/ministryofjustice/opg-modernising-lpa/internal/date" "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" @@ -404,9 +405,10 @@ func lpaResponseToLpa(l lpaResponse) *lpadata.Lpa { }, HowShouldReplacementAttorneysStepIn: l.HowReplacementAttorneysStepIn, HowShouldReplacementAttorneysStepInDetails: l.HowReplacementAttorneysStepInDetails, - Restrictions: l.Restrictions, - WhenCanTheLpaBeUsed: l.WhenTheLpaCanBeUsed, - LifeSustainingTreatmentOption: l.LifeSustainingTreatmentOption, + Restrictions: l.Restrictions, + WhenCanTheLpaBeUsed: l.WhenTheLpaCanBeUsed, + LifeSustainingTreatmentOption: l.LifeSustainingTreatmentOption, + // TODO: add authorised signatory and independent witness when these become available SignedAt: l.SignedAt, CertificateProviderNotRelatedConfirmedAt: confirmedAt, CannotRegister: l.Status == "cannot-register", @@ -484,6 +486,26 @@ func FromDonorProvidedDetails(l *donordata.Provided) *lpadata.Lpa { } } + var authorisedSignatory lpadata.Actor + if v := l.AuthorisedSignatory; v.FirstNames != "" { + authorisedSignatory = lpadata.Actor{ + // TODO: add UID for this actor + Type: actor.TypeAuthorisedSignatory, + FirstNames: v.FirstNames, + LastName: v.LastName, + } + } + + var independentWitness lpadata.Actor + if v := l.IndependentWitness; v.FirstNames != "" { + independentWitness = lpadata.Actor{ + // TODO: add UID for this actor + Type: actor.TypeIndependentWitness, + FirstNames: v.FirstNames, + LastName: v.LastName, + } + } + return &lpadata.Lpa{ LpaID: l.LpaID, LpaUID: l.LpaUID, @@ -533,7 +555,9 @@ func FromDonorProvidedDetails(l *donordata.Provided) *lpadata.Lpa { LastName: l.Correspondent.LastName, Email: l.Correspondent.Email, }, - Voucher: voucher, + AuthorisedSignatory: authorisedSignatory, + IndependentWitness: independentWitness, + Voucher: voucher, } } diff --git a/internal/lpastore/lpadata/lpa.go b/internal/lpastore/lpadata/lpa.go index 9fd20a0e1c..8cad52c252 100644 --- a/internal/lpastore/lpadata/lpa.go +++ b/internal/lpastore/lpadata/lpa.go @@ -1,8 +1,11 @@ package lpadata import ( + "iter" "time" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" ) @@ -28,6 +31,8 @@ type Lpa struct { Restrictions string WhenCanTheLpaBeUsed CanBeUsedWhen LifeSustainingTreatmentOption LifeSustainingTreatment + AuthorisedSignatory Actor + IndependentWitness Actor // SignedAt is the date the Donor signed their LPA (and signifies it has been // witnessed by their CertificateProvider) @@ -99,3 +104,79 @@ func (l Lpa) AllAttorneysSigned() bool { return true } + +type Actor struct { + Type actor.Type + UID actoruid.UID + FirstNames string + LastName string +} + +// Actors returns an iterator over all human actors named on the LPA (i.e. this +// excludes trust corporations, the correspondent, and the voucher). +func (l Lpa) Actors() iter.Seq[Actor] { + return func(yield func(Actor) bool) { + if !yield(Actor{ + Type: actor.TypeDonor, + UID: l.Donor.UID, + FirstNames: l.Donor.FirstNames, + LastName: l.Donor.LastName, + }) { + return + } + + if !yield(Actor{ + Type: actor.TypeCertificateProvider, + UID: l.CertificateProvider.UID, + FirstNames: l.CertificateProvider.FirstNames, + LastName: l.CertificateProvider.LastName, + }) { + return + } + + for _, attorney := range l.Attorneys.Attorneys { + if !yield(Actor{ + Type: actor.TypeAttorney, + UID: attorney.UID, + FirstNames: attorney.FirstNames, + LastName: attorney.LastName, + }) { + return + } + } + + for _, attorney := range l.ReplacementAttorneys.Attorneys { + if !yield(Actor{ + Type: actor.TypeReplacementAttorney, + UID: attorney.UID, + FirstNames: attorney.FirstNames, + LastName: attorney.LastName, + }) { + return + } + } + + for _, person := range l.PeopleToNotify { + if !yield(Actor{ + Type: actor.TypePersonToNotify, + UID: person.UID, + FirstNames: person.FirstNames, + LastName: person.LastName, + }) { + return + } + } + + if !l.AuthorisedSignatory.UID.IsZero() { + if !yield(l.AuthorisedSignatory) { + return + } + } + + if !l.IndependentWitness.UID.IsZero() { + if !yield(l.IndependentWitness) { + return + } + } + } +} diff --git a/internal/lpastore/lpadata/lpa_test.go b/internal/lpastore/lpadata/lpa_test.go index 0c5a9554f3..1ad709a145 100644 --- a/internal/lpastore/lpadata/lpa_test.go +++ b/internal/lpastore/lpadata/lpa_test.go @@ -1,9 +1,12 @@ package lpadata import ( + "slices" "testing" "time" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" "github.com/stretchr/testify/assert" ) @@ -87,3 +90,96 @@ func TestLpaCorrespondentEmailWhenCorrespondentProvided(t *testing.T) { } assert.Equal(t, "correspondent", lpa.CorrespondentEmail()) } + +func TestLpaActors(t *testing.T) { + authorisedSignatory := Actor{UID: actoruid.New()} + independentWitness := Actor{UID: actoruid.New()} + + lpa := &Lpa{ + Donor: Donor{ + UID: actoruid.New(), + FirstNames: "Sam", + LastName: "Smith", + }, + CertificateProvider: CertificateProvider{ + UID: actoruid.New(), + FirstNames: "Charlie", + LastName: "Cooper", + }, + Attorneys: Attorneys{ + Attorneys: []Attorney{{ + UID: actoruid.New(), + FirstNames: "Alan", + LastName: "Attorney", + }, { + UID: actoruid.New(), + FirstNames: "Angela", + LastName: "Attorney", + }}, + TrustCorporation: TrustCorporation{Name: "Trusty"}, + }, + ReplacementAttorneys: Attorneys{ + Attorneys: []Attorney{{ + UID: actoruid.New(), + FirstNames: "Richard", + LastName: "Replacement", + }, { + UID: actoruid.New(), + FirstNames: "Rachel", + LastName: "Replacement", + }}, + TrustCorporation: TrustCorporation{Name: "Untrusty"}, + }, + PeopleToNotify: []PersonToNotify{{ + UID: actoruid.New(), + FirstNames: "Peter", + LastName: "Person", + }}, + AuthorisedSignatory: authorisedSignatory, + IndependentWitness: independentWitness, + Correspondent: Correspondent{FirstNames: "Nope"}, + Voucher: Voucher{FirstNames: "Nada"}, + } + + actors := slices.Collect(lpa.Actors()) + + assert.Equal(t, []Actor{{ + Type: actor.TypeDonor, + UID: lpa.Donor.UID, + FirstNames: "Sam", + LastName: "Smith", + }, { + Type: actor.TypeCertificateProvider, + UID: lpa.CertificateProvider.UID, + FirstNames: "Charlie", + LastName: "Cooper", + }, { + Type: actor.TypeAttorney, + UID: lpa.Attorneys.Attorneys[0].UID, + FirstNames: "Alan", + LastName: "Attorney", + }, { + Type: actor.TypeAttorney, + UID: lpa.Attorneys.Attorneys[1].UID, + FirstNames: "Angela", + LastName: "Attorney", + }, { + Type: actor.TypeReplacementAttorney, + UID: lpa.ReplacementAttorneys.Attorneys[0].UID, + FirstNames: "Richard", + LastName: "Replacement", + }, { + Type: actor.TypeReplacementAttorney, + UID: lpa.ReplacementAttorneys.Attorneys[1].UID, + FirstNames: "Rachel", + LastName: "Replacement", + }, { + Type: actor.TypePersonToNotify, + UID: lpa.PeopleToNotify[0].UID, + FirstNames: "Peter", + LastName: "Person", + }, + authorisedSignatory, + independentWitness, + }, actors) +} diff --git a/internal/lpastore/resolving_service.go b/internal/lpastore/resolving_service.go index 1feccab8aa..f1237d1e00 100644 --- a/internal/lpastore/resolving_service.go +++ b/internal/lpastore/resolving_service.go @@ -4,6 +4,7 @@ import ( "context" "errors" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" "github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" @@ -102,7 +103,6 @@ func (s *ResolvingService) merge(lpa *lpadata.Lpa, donor *donordata.Provided) *l LastName: donor.Correspondent.LastName, Email: donor.Correspondent.Email, } - if donor.Voucher.Allowed { lpa.Voucher = lpadata.Voucher{ UID: donor.Voucher.UID, @@ -112,6 +112,24 @@ func (s *ResolvingService) merge(lpa *lpadata.Lpa, donor *donordata.Provided) *l } } + // TODO: remove this once authorised signatory is in lpa-store + if lpa.AuthorisedSignatory.FirstNames == "" && donor.AuthorisedSignatory.FirstNames != "" { + lpa.AuthorisedSignatory = lpadata.Actor{ + Type: actor.TypeAuthorisedSignatory, + FirstNames: donor.AuthorisedSignatory.FirstNames, + LastName: donor.AuthorisedSignatory.LastName, + } + } + + // TODO: remove this once independent witness is in lpa-store + if lpa.IndependentWitness.FirstNames == "" && donor.IndependentWitness.FirstNames != "" { + lpa.IndependentWitness = lpadata.Actor{ + Type: actor.TypeIndependentWitness, + FirstNames: donor.IndependentWitness.FirstNames, + LastName: donor.IndependentWitness.LastName, + } + } + // copy the relationship as it isn't stored in the lpastore. lpa.CertificateProvider.Relationship = donor.CertificateProvider.Relationship diff --git a/internal/lpastore/resolving_service_test.go b/internal/lpastore/resolving_service_test.go index 97bb60eebd..7c6c54cd78 100644 --- a/internal/lpastore/resolving_service_test.go +++ b/internal/lpastore/resolving_service_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" "github.com/ministryofjustice/opg-modernising-lpa/internal/identity" @@ -39,8 +40,10 @@ func TestResolvingServiceGet(t *testing.T) { Status: identity.StatusConfirmed, RetrievedAt: time.Now(), }, - Correspondent: donordata.Correspondent{Email: "x"}, - Voucher: donordata.Voucher{Allowed: true, Email: "y"}, + Correspondent: donordata.Correspondent{Email: "x"}, + AuthorisedSignatory: donordata.AuthorisedSignatory{FirstNames: "A", LastName: "S"}, + IndependentWitness: donordata.IndependentWitness{FirstNames: "I", LastName: "W"}, + Voucher: donordata.Voucher{Allowed: true, Email: "y"}, }, resolved: &lpadata.Lpa{ LpaID: "1", @@ -62,7 +65,17 @@ func TestResolvingServiceGet(t *testing.T) { }, Donor: lpadata.Donor{Channel: lpadata.ChannelOnline}, Correspondent: lpadata.Correspondent{Email: "x"}, - Voucher: lpadata.Voucher{Email: "y"}, + AuthorisedSignatory: lpadata.Actor{ + Type: actor.TypeAuthorisedSignatory, + FirstNames: "A", + LastName: "S", + }, + IndependentWitness: lpadata.Actor{ + Type: actor.TypeIndependentWitness, + FirstNames: "I", + LastName: "W", + }, + Voucher: lpadata.Voucher{Email: "y"}, }, }, "online with no lpastore record": { @@ -86,8 +99,10 @@ func TestResolvingServiceGet(t *testing.T) { Status: identity.StatusConfirmed, RetrievedAt: time.Date(2020, time.January, 2, 12, 13, 14, 5, time.UTC), }, - Correspondent: donordata.Correspondent{Email: "x"}, - Voucher: donordata.Voucher{Allowed: true, Email: "y"}, + Correspondent: donordata.Correspondent{Email: "x"}, + AuthorisedSignatory: donordata.AuthorisedSignatory{FirstNames: "A", LastName: "S"}, + IndependentWitness: donordata.IndependentWitness{FirstNames: "I", LastName: "W"}, + Voucher: donordata.Voucher{Allowed: true, Email: "y"}, }, error: ErrNotFound, expected: &lpadata.Lpa{ @@ -113,7 +128,17 @@ func TestResolvingServiceGet(t *testing.T) { TrustCorporation: lpadata.TrustCorporation{Name: "d"}, }, Correspondent: lpadata.Correspondent{Email: "x"}, - Voucher: lpadata.Voucher{Email: "y"}, + AuthorisedSignatory: lpadata.Actor{ + Type: actor.TypeAuthorisedSignatory, + FirstNames: "A", + LastName: "S", + }, + IndependentWitness: lpadata.Actor{ + Type: actor.TypeIndependentWitness, + FirstNames: "I", + LastName: "W", + }, + Voucher: lpadata.Voucher{Email: "y"}, }, }, "online with all false": { diff --git a/internal/voucher/voucherdata/provided.go b/internal/voucher/voucherdata/provided.go index d2cd6d8f75..4fedaf5104 100644 --- a/internal/voucher/voucherdata/provided.go +++ b/internal/voucher/voucherdata/provided.go @@ -1,12 +1,14 @@ package voucherdata import ( + "strings" "time" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" "github.com/ministryofjustice/opg-modernising-lpa/internal/form" "github.com/ministryofjustice/opg-modernising-lpa/internal/identity" - "github.com/ministryofjustice/opg-modernising-lpa/internal/task" + "github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" ) // Provided contains the information a voucher has given @@ -35,17 +37,25 @@ type Provided struct { SignedAt time.Time } -func (p Provided) FullName() string { +func (p *Provided) FullName() string { return p.FirstNames + " " + p.LastName } -func (p Provided) IdentityConfirmed() bool { +func (p *Provided) IdentityConfirmed() bool { return p.IdentityUserData.Status.IsConfirmed() && p.IdentityUserData.MatchName(p.FirstNames, p.LastName) } -type Tasks struct { - ConfirmYourName task.State - VerifyDonorDetails task.State - ConfirmYourIdentity task.State - SignTheDeclaration task.State +func (p *Provided) NameMatches(lpa *lpadata.Lpa) actor.Type { + if p.FirstNames == "" && p.LastName == "" { + return actor.TypeNone + } + + for person := range lpa.Actors() { + if strings.EqualFold(person.FirstNames, p.FirstNames) && + strings.EqualFold(person.LastName, p.LastName) { + return person.Type + } + } + + return actor.TypeNone } diff --git a/internal/voucher/voucherdata/provided_test.go b/internal/voucher/voucherdata/provided_test.go index 4627844891..ffdb0b8d07 100644 --- a/internal/voucher/voucherdata/provided_test.go +++ b/internal/voucher/voucherdata/provided_test.go @@ -3,16 +3,20 @@ package voucherdata import ( "testing" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/identity" + "github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" "github.com/stretchr/testify/assert" ) func TestProvidedFullName(t *testing.T) { - assert.Equal(t, "John Smith", Provided{FirstNames: "John", LastName: "Smith"}.FullName()) + provided := &Provided{FirstNames: "John", LastName: "Smith"} + + assert.Equal(t, "John Smith", provided.FullName()) } func TestProvidedIdentityConfirmed(t *testing.T) { - assert.True(t, Provided{ + provided := &Provided{ FirstNames: "X", LastName: "Y", IdentityUserData: identity.UserData{ @@ -20,11 +24,13 @@ func TestProvidedIdentityConfirmed(t *testing.T) { FirstNames: "X", LastName: "Y", }, - }.IdentityConfirmed()) + } + + assert.True(t, provided.IdentityConfirmed()) } func TestProvidedIdentityConfirmedWhenNameNotMatch(t *testing.T) { - assert.False(t, Provided{ + provided := &Provided{ FirstNames: "A", LastName: "Y", IdentityUserData: identity.UserData{ @@ -32,11 +38,13 @@ func TestProvidedIdentityConfirmedWhenNameNotMatch(t *testing.T) { FirstNames: "X", LastName: "Y", }, - }.IdentityConfirmed()) + } + + assert.False(t, provided.IdentityConfirmed()) } func TestProvidedIdentityConfirmedWhenNotConfirmed(t *testing.T) { - assert.False(t, Provided{ + provided := &Provided{ FirstNames: "X", LastName: "Y", IdentityUserData: identity.UserData{ @@ -44,5 +52,28 @@ func TestProvidedIdentityConfirmedWhenNotConfirmed(t *testing.T) { FirstNames: "X", LastName: "Y", }, - }.IdentityConfirmed()) + } + + assert.False(t, provided.IdentityConfirmed()) +} + +func TestProvidedNameMatches(t *testing.T) { + provided := &Provided{FirstNames: "A", LastName: "B"} + lpa := &lpadata.Lpa{Voucher: lpadata.Voucher{FirstNames: "A", LastName: "B"}} + + assert.Equal(t, actor.TypeNone, provided.NameMatches(lpa)) +} + +func TestProvidedNameMatchesWhenUnset(t *testing.T) { + provided := &Provided{} + lpa := &lpadata.Lpa{} + + assert.Equal(t, actor.TypeNone, provided.NameMatches(lpa)) +} + +func TestProvidedNameMatchesWhenMatch(t *testing.T) { + provided := &Provided{FirstNames: "A", LastName: "B"} + lpa := &lpadata.Lpa{Donor: lpadata.Donor{FirstNames: "A", LastName: "B"}} + + assert.Equal(t, actor.TypeDonor, provided.NameMatches(lpa)) } diff --git a/internal/voucher/voucherdata/tasks.go b/internal/voucher/voucherdata/tasks.go new file mode 100644 index 0000000000..23aba9b015 --- /dev/null +++ b/internal/voucher/voucherdata/tasks.go @@ -0,0 +1,10 @@ +package voucherdata + +import "github.com/ministryofjustice/opg-modernising-lpa/internal/task" + +type Tasks struct { + ConfirmYourName task.State + VerifyDonorDetails task.State + ConfirmYourIdentity task.State + SignTheDeclaration task.State +} diff --git a/internal/voucher/voucherpage/confirm_allowed_to_vouch.go b/internal/voucher/voucherpage/confirm_allowed_to_vouch.go index 7053dea3aa..7228bbc058 100644 --- a/internal/voucher/voucherpage/confirm_allowed_to_vouch.go +++ b/internal/voucher/voucherpage/confirm_allowed_to_vouch.go @@ -15,10 +15,11 @@ import ( ) type confirmAllowedToVouchData struct { - App appcontext.Data - Errors validation.List - Form *form.YesNoForm - Lpa *lpadata.Lpa + App appcontext.Data + Errors validation.List + Form *form.YesNoForm + Lpa *lpadata.Lpa + SurnameMatchesDonor bool } func ConfirmAllowedToVouch(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore) Handler { @@ -29,9 +30,10 @@ func ConfirmAllowedToVouch(tmpl template.Template, lpaStoreResolvingService LpaS } data := &confirmAllowedToVouchData{ - App: appData, - Form: form.NewYesNoForm(form.YesNoUnknown), - Lpa: lpa, + App: appData, + Form: form.NewYesNoForm(form.YesNoUnknown), + Lpa: lpa, + SurnameMatchesDonor: provided.LastName == lpa.Donor.LastName, } if r.Method == http.MethodPost { diff --git a/internal/voucher/voucherpage/confirm_allowed_to_vouch_test.go b/internal/voucher/voucherpage/confirm_allowed_to_vouch_test.go index f762505b48..8850b206c8 100644 --- a/internal/voucher/voucherpage/confirm_allowed_to_vouch_test.go +++ b/internal/voucher/voucherpage/confirm_allowed_to_vouch_test.go @@ -31,11 +31,12 @@ func TestGetConfirmAllowedToVouch(t *testing.T) { template := newMockTemplate(t) template.EXPECT(). Execute(w, &confirmAllowedToVouchData{ - App: testAppData, + App: testAppData, + Form: form.NewYesNoForm(form.YesNoUnknown), Lpa: &lpadata.Lpa{ Voucher: lpadata.Voucher{FirstNames: "V", LastName: "W"}, }, - Form: form.NewYesNoForm(form.YesNoUnknown), + SurnameMatchesDonor: true, }). Return(nil) diff --git a/internal/voucher/voucherpage/confirm_your_name.go b/internal/voucher/voucherpage/confirm_your_name.go index ddc191bf67..e7d43b6c71 100644 --- a/internal/voucher/voucherpage/confirm_your_name.go +++ b/internal/voucher/voucherpage/confirm_your_name.go @@ -45,7 +45,7 @@ func ConfirmYourName(tmpl template.Template, lpaStoreResolvingService LpaStoreRe provided.FirstNames = firstNames provided.LastName = lastName - if lastName == lpa.Donor.LastName { + if lastName == lpa.Donor.LastName || !provided.NameMatches(lpa).IsNone() { redirect = voucher.PathConfirmAllowedToVouch state = task.StateInProgress } diff --git a/lang/cy.json b/lang/cy.json index 26e3d90f70..5445036afc 100644 --- a/lang/cy.json +++ b/lang/cy.json @@ -1350,5 +1350,6 @@ "toTheBestOfMyKnowledgeDeclaration": "Welsh {{.DonorFullName}}", "thankYou": "Welsh", "youHaveVouchedFor": "Welsh {{.DonorFullNamePossessive}}", - "voucherThankYouContent": "

Welsh {{.DonorFirstNamesPossessive}}

" + "voucherThankYouContent": "

Welsh {{.DonorFirstNamesPossessive}}

", + "youHaveEnteredNameWhichMatchesSomeone": "Welsh {{.DonorFullNamePossessive}}" } diff --git a/lang/en.json b/lang/en.json index b021f024db..3ff1db8624 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1279,5 +1279,6 @@ "toTheBestOfMyKnowledgeDeclaration": "To the best of my knowledge, the person who asked me to vouch for them is {{.DonorFullName}} and I have known them for at least 2 years.", "thankYou": "Thank you", "youHaveVouchedFor": "You have vouched for {{.DonorFullNamePossessive}} identity.", - "voucherThankYouContent": "

You do not need to do anything else.

{{.DonorFirstNamesPossessive}} vouching request will no longer appear on your dashboard.

You can print this page out for your records if you wish, or close this browsing window.

" + "voucherThankYouContent": "

You do not need to do anything else.

{{.DonorFirstNamesPossessive}} vouching request will no longer appear on your dashboard.

You can print this page out for your records if you wish, or close this browsing window.

", + "youHaveEnteredNameWhichMatchesSomeone": "You have entered a name that matches someone named on {{.DonorFullNamePossessive}} lasting power of attorney (LPA)." } diff --git a/web/template/voucher/confirm_allowed_to_vouch.gohtml b/web/template/voucher/confirm_allowed_to_vouch.gohtml index ea308e156f..78be805a02 100644 --- a/web/template/voucher/confirm_allowed_to_vouch.gohtml +++ b/web/template/voucher/confirm_allowed_to_vouch.gohtml @@ -6,12 +6,17 @@
{{ template "information-banner" (content .App "youMustReviewTheInformationYouHaveEntered") }} - +

{{ tr .App "confirmThatYouAreAllowedToVouch" }}

- {{ trFormat .App "theDonorsLastNameMatchesYours" - "DonorFullNamePossessive" (possessive .App .Lpa.Donor.FullName) }} + {{ if .SurnameMatchesDonor }} + {{ trFormat .App "theDonorsLastNameMatchesYours" + "DonorFullNamePossessive" (possessive .App .Lpa.Donor.FullName) }} + {{ else }} + {{ trFormat .App "youHaveEnteredNameWhichMatchesSomeone" + "DonorFullNamePossessive" (possessive .App .Lpa.Donor.FullName) }} + {{ end }}

{{ trFormatHtml .App "thePersonVouchingCannot" @@ -31,7 +36,7 @@ (item .Form.Options.No.String "no")) }}
- + {{ template "buttons" (button .App "continue") }} {{ template "csrf-field" . }}