diff --git a/cypress/e2e/attorney/confirm-your-details.cy.js b/cypress/e2e/attorney/confirm-your-details.cy.js index f4fa6e108f..ce493c1216 100644 --- a/cypress/e2e/attorney/confirm-your-details.cy.js +++ b/cypress/e2e/attorney/confirm-your-details.cy.js @@ -2,7 +2,7 @@ import { TestMobile } from '../../support/e2e'; describe('Confirm your details', () => { beforeEach(() => { - cy.visit('/testing-start?redirect=/mobile-number&lpa.attorneys=1&attorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/mobile-number'); cy.get('#f-mobile').type(TestMobile); cy.contains('Continue').click(); diff --git a/cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js b/cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js index 782a56b85c..f27a5eac59 100644 --- a/cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js +++ b/cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js @@ -1,6 +1,6 @@ describe('Legal rights and responsibilities', () => { it('can continue to next page', () => { - cy.visit('/testing-start?redirect=/legal-rights-and-responsibilities&lpa.complete=1&lpa.attorneys=1&lpa.signedByDonor=1&attorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/legal-rights-and-responsibilities'); cy.contains('h1', "Your legal rights and responsibilities") diff --git a/cypress/e2e/attorney/mobile-number.cy.js b/cypress/e2e/attorney/mobile-number.cy.js index a08c370e7d..5698c32067 100644 --- a/cypress/e2e/attorney/mobile-number.cy.js +++ b/cypress/e2e/attorney/mobile-number.cy.js @@ -2,7 +2,7 @@ import { TestMobile } from "../../support/e2e"; describe('Mobile number', () => { beforeEach(() => { - cy.visit('/testing-start?lpa.complete=1&attorneyProvided=1&redirect=/mobile-number&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/mobile-number'); }); it('can be completed', () => { diff --git a/cypress/e2e/attorney/read-the-lpa.cy.js b/cypress/e2e/attorney/read-the-lpa.cy.js index 4a80e11046..8058ef60a5 100644 --- a/cypress/e2e/attorney/read-the-lpa.cy.js +++ b/cypress/e2e/attorney/read-the-lpa.cy.js @@ -1,6 +1,6 @@ describe('Read the LPA', () => { it('displays the LPA details with actor specific content', () => { - cy.visit('/testing-start?redirect=/read-the-lpa&lpa.complete=1&attorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/read-the-lpa'); cy.contains('dt', "When attorneys can use the LPA") cy.contains('dt', "Attorney names") diff --git a/cypress/e2e/attorney/sign.cy.js b/cypress/e2e/attorney/sign.cy.js index 6c2a1c653f..a551839096 100644 --- a/cypress/e2e/attorney/sign.cy.js +++ b/cypress/e2e/attorney/sign.cy.js @@ -1,7 +1,7 @@ describe('Sign', () => { describe('as an attorney', () => { beforeEach(() => { - cy.visit('/testing-start?cookiesAccepted=1&redirect=/sign&lpa.complete=1&attorneyProvided=1&asCertificateProvider=certified&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/sign&progress=signedByCertificateProvider'); }); it('can be signed', () => { @@ -31,7 +31,7 @@ describe('Sign', () => { describe('as a replacement attorney', () => { beforeEach(() => { - cy.visit('/testing-start?cookiesAccepted=1&redirect=/sign&lpa.complete=1&withReplacementAttorney=1&lpa.signedByDonor=1&asCertificateProvider=certified&replacementAttorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/sign&is-replacement=1&progress=signedByCertificateProvider'); }); it('can be signed', () => { diff --git a/cypress/e2e/attorney/task-list.cy.js b/cypress/e2e/attorney/task-list.cy.js index bfe0ba4cc6..0ffb72f277 100644 --- a/cypress/e2e/attorney/task-list.cy.js +++ b/cypress/e2e/attorney/task-list.cy.js @@ -1,6 +1,6 @@ describe('Task list', () => { beforeEach(() => { - cy.visit('/testing-start?redirect=/task-list&lpa.complete=1&attorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/task-list'); }); it('shows tasks', () => { diff --git a/cypress/e2e/attorney/trust-corporation.cy.js b/cypress/e2e/attorney/trust-corporation.cy.js index 44990969a9..b89a0afde0 100644 --- a/cypress/e2e/attorney/trust-corporation.cy.js +++ b/cypress/e2e/attorney/trust-corporation.cy.js @@ -1,8 +1,8 @@ -const { TestMobile } = require("../../support/e2e"); +const { TestMobile, TestEmail } = require("../../support/e2e"); describe('As a trust corporation', () => { beforeEach(() => { - cy.visit('/testing-start?redirect=/attorney-start&lpa.complete=1&lpa.trustCorporation=complete&useTestShareCode=1&sendAttorneyShare=1&lpa.signedByDonor=1&asCertificateProvider=certified'); + cy.visit('/fixtures/attorney?redirect=/attorney-start&is-trust-corporation=1&progress=signedByCertificateProvider&use-test-code=1&email=' + TestEmail); // start cy.contains('a', 'Start').click(); @@ -25,11 +25,11 @@ describe('As a trust corporation', () => { // confirm your company details cy.contains(TestMobile); cy.contains('Confirm your company details'); - cy.contains('My company'); + cy.contains('First Choice Trust Corporation Ltd.'); cy.contains('555555555'); cy.contains('simulate-delivered@notifications.service.gov.uk'); - cy.contains('123 Fake Street'); - cy.contains('FF1 1FF'); + cy.contains('2 RICHMOND PLACE'); + cy.contains('B14 7ED'); cy.contains('button', 'Continue').click(); // read the lpa @@ -59,7 +59,7 @@ describe('As a trust corporation', () => { cy.contains('button', 'Continue').click(); // what happens next - cy.contains('My company has formally agreed to be an attorney'); + cy.contains('First Choice Trust Corporation Ltd. has formally agreed to be an attorney'); cy.contains('a', 'Go to your dashboard'); }); @@ -89,7 +89,7 @@ describe('As a trust corporation', () => { cy.contains('button', 'Submit signature').click(); // what happens next - cy.contains('My company has formally agreed to be an attorney'); + cy.contains('First Choice Trust Corporation Ltd. has formally agreed to be an attorney'); cy.contains('a', 'Go to your dashboard'); }); @@ -119,7 +119,7 @@ describe('As a trust corporation', () => { cy.contains('button', 'Continue').click(); // what happens next - cy.contains('My company has formally agreed to be an attorney'); + cy.contains('First Choice Trust Corporation Ltd. has formally agreed to be an attorney'); cy.contains('a', 'Go to your dashboard'); }); }); diff --git a/cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js b/cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js index 40f20c8bb7..bacb14007f 100644 --- a/cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js +++ b/cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js @@ -1,6 +1,6 @@ describe('What happens when you sign the LPA', () => { it('as a property and affairs attorney', () => { - cy.visit('/testing-start?redirect=/what-happens-when-you-sign-the-lpa&lpa.complete=1&attorneyProvided=1&lpa.signedByDonor=1&asCertificateProvider=certified&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=signedByCertificateProvider'); cy.contains('h1', "What happens when you sign the LPA") cy.contains('p', "you’re officially saying that you want to be an attorney on") @@ -13,7 +13,7 @@ describe('What happens when you sign the LPA', () => { }); it('as a personal welfare attorney', () => { - cy.visit('/testing-start?redirect=/what-happens-when-you-sign-the-lpa&lpa.complete=1&attorneyProvided=1&lpa.type=hw&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=hw&progress=signedByCertificateProvider'); cy.contains('p', "you’re officially saying that you want to be an attorney on") cy.contains('li', "their personal and medical care") @@ -21,7 +21,7 @@ describe('What happens when you sign the LPA', () => { }); it('as a property and affairs replacement attorney', () => { - cy.visit('/testing-start?redirect=/what-happens-when-you-sign-the-lpa&lpa.complete=1&replacementAttorneyProvided=1&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=signedByCertificateProvider&is-replacement=1'); cy.contains('p', "you’re saying that you want to be a replacement attorney") cy.contains('li', "make decisions about their money or property") @@ -29,7 +29,7 @@ describe('What happens when you sign the LPA', () => { }); it('as a personal welfare replacement attorney', () => { - cy.visit('/testing-start?redirect=/what-happens-when-you-sign-the-lpa&lpa.complete=1&replacementAttorneyProvided=1&lpa.type=hw&loginAs=attorney'); + cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=hw&progress=signedByCertificateProvider&is-replacement=1'); cy.contains('p', "you’re saying that you want to be a replacement attorney ") cy.contains('li', "their personal and medical care") diff --git a/internal/app/app.go b/internal/app/app.go index cd7b33e789..89338236ca 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -109,6 +109,8 @@ func App( page.SignOut(logger, sessionStore, oneLoginClient, appPublicURL)) handleRoot(paths.Fixtures, None, page.Fixtures(tmpls.Get("fixtures.gohtml"))) + handleRoot(paths.AttorneyFixtures, None, + page.AttorneyFixtures(tmpls.Get("attorney_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore, attorneyStore)) handleRoot(paths.YourLegalRightsAndResponsibilities, None, page.Guidance(tmpls.Get("your_legal_rights_and_responsibilities_general.gohtml"))) handleRoot(page.Paths.Start, None, diff --git a/internal/app/dashboard_store.go b/internal/app/dashboard_store.go index 11a5da56bd..7bf14c2957 100644 --- a/internal/app/dashboard_store.go +++ b/internal/app/dashboard_store.go @@ -11,6 +11,7 @@ import ( "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" "github.com/ministryofjustice/opg-modernising-lpa/internal/page" + "golang.org/x/exp/maps" ) // An lpaLink is used to join an actor to an LPA. @@ -131,6 +132,11 @@ func (s *dashboardStore) GetAll(ctx context.Context) (donor, attorney, certifica } if entry, ok := attorneyMap[attorneyProvidedDetails.LpaID]; ok { + if attorneyProvidedDetails.IsReplacement && !entry.Lpa.SubmittedAt.IsZero() { + delete(attorneyMap, attorneyProvidedDetails.LpaID) + continue + } + entry.Attorney = attorneyProvidedDetails attorneyMap[attorneyProvidedDetails.LpaID] = entry continue @@ -154,13 +160,8 @@ func (s *dashboardStore) GetAll(ctx context.Context) (donor, attorney, certifica } } - for _, value := range certificateProviderMap { - certificateProvider = append(certificateProvider, value) - } - - for _, value := range attorneyMap { - attorney = append(attorney, value) - } + certificateProvider = maps.Values(certificateProviderMap) + attorney = maps.Values(attorneyMap) byUpdatedAt := func(a, b page.LpaAndActorTasks) int { if a.Lpa.UpdatedAt.After(b.Lpa.UpdatedAt) { diff --git a/internal/page/attorney_fixtures.go b/internal/page/attorney_fixtures.go new file mode 100644 index 0000000000..24061610cd --- /dev/null +++ b/internal/page/attorney_fixtures.go @@ -0,0 +1,264 @@ +package page + +import ( + "encoding/base64" + "net/http" + "slices" + "time" + + "github.com/ministryofjustice/opg-go-common/template" + "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" + "github.com/ministryofjustice/opg-modernising-lpa/internal/date" + "github.com/ministryofjustice/opg-modernising-lpa/internal/form" + "github.com/ministryofjustice/opg-modernising-lpa/internal/place" + "github.com/ministryofjustice/opg-modernising-lpa/internal/random" + "github.com/ministryofjustice/opg-modernising-lpa/internal/sesh" + "github.com/ministryofjustice/opg-modernising-lpa/internal/validation" +) + +type attorneyFixturesData struct { + App AppData + Errors validation.List +} + +func AttorneyFixtures( + tmpl template.Template, + sessionStore sesh.Store, + shareCodeSender *ShareCodeSender, + donorStore DonorStore, + certificateProviderStore CertificateProviderStore, + attorneyStore AttorneyStore, +) Handler { + const ( + testEmail = "simulate-delivered@notifications.service.gov.uk" + testMobile = "07700900000" + ) + + type Name struct { + Firstnames, Lastname string + } + + var ( + progressValues = []string{ + "signedByCertificateProvider", + "signedByAttorney", + "submitted", + "registered", + } + attorneyNames = []Name{ + {Firstnames: "Jessie", Lastname: "Jones"}, + {Firstnames: "Robin", Lastname: "Redcar"}, + {Firstnames: "Leslie", Lastname: "Lewis"}, + {Firstnames: "Ashley", Lastname: "Alwinton"}, + {Firstnames: "Frankie", Lastname: "Fernandes"}, + } + replacementAttorneyNames = []Name{ + {Firstnames: "Blake", Lastname: "Buckley"}, + {Firstnames: "Taylor", Lastname: "Thompson"}, + {Firstnames: "Marley", Lastname: "Morris"}, + {Firstnames: "Alex", Lastname: "Abbott"}, + {Firstnames: "Billie", Lastname: "Blair"}, + } + ) + + makeAttorney := func(name Name) actor.Attorney { + return actor.Attorney{ + ID: name.Firstnames + name.Lastname, + FirstNames: name.Firstnames, + LastName: name.Lastname, + Email: testEmail, + DateOfBirth: date.New("2000", "1", "2"), + Address: place.Address{ + Line1: "2 RICHMOND PLACE", + Line2: "KINGS HEATH", + Line3: "WEST MIDLANDS", + TownOrCity: "BIRMINGHAM", + Postcode: "B14 7ED", + }, + } + } + + makeTrustCorporation := func(name string) actor.TrustCorporation { + return actor.TrustCorporation{ + Name: name, + CompanyNumber: "555555555", + Email: testEmail, + Address: place.Address{ + Line1: "2 RICHMOND PLACE", + Line2: "KINGS HEATH", + Line3: "WEST MIDLANDS", + TownOrCity: "BIRMINGHAM", + Postcode: "B14 7ED", + }, + } + } + + return func(appData AppData, w http.ResponseWriter, r *http.Request) error { + var ( + isReplacement = r.FormValue("is-replacement") == "1" + isTrustCorporation = r.FormValue("is-trust-corporation") == "1" + lpaType = r.FormValue("lpa-type") + progress = slices.Index(progressValues, r.FormValue("progress")) + email = r.FormValue("email") + redirect = r.FormValue("redirect") + ) + + if r.Method != http.MethodPost && redirect == "" { + return tmpl(w, &attorneyFixturesData{App: appData}) + } + + if lpaType == "hw" && isTrustCorporation { + return tmpl(w, &attorneyFixturesData{App: appData, Errors: validation.With("", validation.CustomError{Label: "Can't add a trust corporation to a personal welfare LPA"})}) + } + + var ( + donorSub = random.String(16) + attorneySub = random.String(16) + certificateProviderSub = random.String(16) + donorSessionID = base64.StdEncoding.EncodeToString([]byte(donorSub)) + certificateProviderSessionID = base64.StdEncoding.EncodeToString([]byte(certificateProviderSub)) + attorneySessionID = base64.StdEncoding.EncodeToString([]byte(attorneySub)) + ) + + if err := sesh.SetLoginSession(sessionStore, r, w, &sesh.LoginSession{Sub: attorneySub, Email: testEmail}); err != nil { + return err + } + + lpa, err := donorStore.Create(ContextWithSessionData(r.Context(), &SessionData{SessionID: donorSessionID})) + if err != nil { + return err + } + + var ( + donorCtx = ContextWithSessionData(r.Context(), &SessionData{SessionID: donorSessionID, LpaID: lpa.ID}) + certificateProviderCtx = ContextWithSessionData(r.Context(), &SessionData{SessionID: certificateProviderSessionID, LpaID: lpa.ID}) + attorneyCtx = ContextWithSessionData(r.Context(), &SessionData{SessionID: attorneySessionID, LpaID: lpa.ID}) + ) + + lpa.Donor = actor.Donor{ + FirstNames: "Sam", + LastName: "Smith", + Address: place.Address{ + Line1: "1 RICHMOND PLACE", + Line2: "KINGS HEATH", + Line3: "WEST MIDLANDS", + TownOrCity: "BIRMINGHAM", + Postcode: "B14 7ED", + }, + Email: testEmail, + DateOfBirth: date.New("2000", "1", "2"), + ThinksCanSign: actor.Yes, + CanSign: form.Yes, + } + lpa.Type = LpaTypePropertyFinance + if lpaType == "hw" && !isTrustCorporation { + lpa.Type = LpaTypeHealthWelfare + } + + lpa.Attorneys = actor.Attorneys{ + Attorneys: []actor.Attorney{makeAttorney(attorneyNames[0])}, + TrustCorporation: makeTrustCorporation("First Choice Trust Corporation Ltd."), + } + lpa.ReplacementAttorneys = actor.Attorneys{ + Attorneys: []actor.Attorney{makeAttorney(replacementAttorneyNames[0])}, + TrustCorporation: makeTrustCorporation("Second Choice Trust Corporation Ltd."), + } + + if email != "" { + if isTrustCorporation { + if isReplacement { + lpa.ReplacementAttorneys.TrustCorporation.Email = email + } else { + lpa.Attorneys.TrustCorporation.Email = email + } + } + if isReplacement { + lpa.ReplacementAttorneys.Attorneys[0].Email = email + } else { + lpa.Attorneys.Attorneys[0].Email = email + } + } + + var attorneyID string + if !isTrustCorporation { + if isReplacement { + attorneyID = lpa.ReplacementAttorneys.Attorneys[0].ID + } else { + attorneyID = lpa.Attorneys.Attorneys[0].ID + } + } + + certificateProvider, err := certificateProviderStore.Create(certificateProviderCtx, donorSessionID) + if err != nil { + return err + } + + certificateProvider.Certificate = actor.Certificate{Agreed: time.Now()} + + attorney, err := attorneyStore.Create(attorneyCtx, donorSessionID, attorneyID, isReplacement, isTrustCorporation) + if err != nil { + return err + } + + if progress >= slices.Index(progressValues, "signedByCertificateProvider") { + lpa.SignedAt = time.Now() + } + if progress >= slices.Index(progressValues, "signedByAttorney") { + attorney.Mobile = testMobile + attorney.Tasks.ConfirmYourDetails = actor.TaskCompleted + attorney.Tasks.ReadTheLpa = actor.TaskCompleted + attorney.Tasks.SignTheLpa = actor.TaskCompleted + + if isTrustCorporation { + attorney.WouldLikeSecondSignatory = form.No + attorney.AuthorisedSignatories = [2]actor.TrustCorporationSignatory{{ + FirstNames: "A", + LastName: "Sign", + ProfessionalTitle: "Assistant to the signer", + Confirmed: time.Now(), + }} + } else { + attorney.Confirmed = time.Now() + } + } + if progress >= slices.Index(progressValues, "submitted") { + lpa.SubmittedAt = time.Now() + } + if progress >= slices.Index(progressValues, "registered") { + lpa.RegisteredAt = time.Now() + } + + if err := donorStore.Put(donorCtx, lpa); err != nil { + return err + } + if err := certificateProviderStore.Put(certificateProviderCtx, certificateProvider); err != nil { + return err + } + if err := attorneyStore.Put(attorneyCtx, attorney); err != nil { + return err + } + + // should only be used in tests as otherwise people can read their emails... + if r.FormValue("use-test-code") == "1" { + useTestCode = true + } + + if email != "" { + shareCodeSender.SendAttorneys(donorCtx, AppData{ + SessionID: donorSessionID, + LpaID: lpa.ID, + Localizer: appData.Localizer, + }, lpa) + + return AppData{}.Redirect(w, r, nil, Paths.Attorney.Start.Format()) + } + + if redirect == "" { + redirect = Paths.Dashboard.Format() + } else { + redirect = "/attorney/" + lpa.ID + redirect + } + + return AppData{}.Redirect(w, r, nil, redirect) + } +} diff --git a/internal/page/paths.go b/internal/page/paths.go index 9b00d94029..5470b1c179 100644 --- a/internal/page/paths.go +++ b/internal/page/paths.go @@ -104,6 +104,7 @@ type AppPaths struct { Root Path SignOut Path Fixtures Path + AttorneyFixtures Path YourLegalRightsAndResponsibilities Path CertificateProviderStart Path Start Path @@ -259,6 +260,7 @@ var Paths = AppPaths{ AboutPayment: "/about-payment", ApplicationReason: "/application-reason", AreYouApplyingForADifferentFeeType: "/are-you-applying-for-a-different-fee-type", + AttorneyFixtures: "/fixtures/attorney", AuthRedirect: "/auth/redirect", CanEvidenceBeUploaded: "/can-evidence-be-uploaded", CertificateProviderAddress: "/certificate-provider-address", diff --git a/lang/cy.json b/lang/cy.json index 489e3b2240..9ec2ad7cc2 100644 --- a/lang/cy.json +++ b/lang/cy.json @@ -815,5 +815,6 @@ "enterYourCompanyPhoneNumberOptional": "Welsh", "youCanChooseToTellUsYourCompanyPhoneNumber": "Welsh", "enterYourCompanyPhoneNumberHint": "Welsh", - "errorCompanyPhoneNumber": "Welsh" + "errorCompanyPhoneNumber": "Welsh", + "lpaNumber": "Welsh" } diff --git a/lang/en.json b/lang/en.json index e0add4adda..0349e6dd1a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -671,7 +671,7 @@ "yourRoleAsCertificateProviderContent": "

Meet and talk with the donor to confirm you have no concerns

The donor, {{ .DonorFullName }}, should get in touch with you to arrange a face-to-face meeting.

By the end of your meeting, you’ll need to have confidence that:

You may wish to take some notes about your conversation. If we ever have any concerns, we may ask you to tell us more about the conversation you had with {{ .DonorFirstNames }}.

Witness the donor signing their LPA

You must witness {{ .DonorFirstNames }} signing their LPA in person.

If they sign on paper, you will need to sign on paper to witness their signature.

If they sign their LPA online, you’ll be sent a code via text message, which you’ll need to provide to {{ .DonorFirstNames }}. This is how you’ll prove you’ve witnessed their signature.

Provide your certificate online

Once you’ve spoken to {{ .DonorFirstNames }}, you’ll need to ‘provide your certificate’ by signing online.

", "goToYourTaskList": "Go to your task list", "iTrustCorporationConfirmTheseStatements": "I am authorised to sign on behalf of {{.TrustCorporationName}} acting as an attorney. I confirm these statements are true and understand that ticking this box acts as my legal signature.", - "signAsTrustCorporationWhenCapacityLostBullet": "The company can make decisionsa and act only when this LPA has been registered and only when the donor does not have mental capacity.", + "signAsTrustCorporationWhenCapacityLostBullet": "The company can make decisions and act only when this LPA has been registered and only when the donor does not have mental capacity.", "signAsTrustCorporationWhenRegisteredBullet": "The company can make decisions and act only when this LPA has been registered.", "signAsTrustCorporationBullets": "
  • On behalf of the company, I have read this lasting power of attorney (LPA) or had it read to me. This includes the company’s legal rights and responsibilities.
  • The company has a duty to act based on the principles of the Mental Capacity Act 2005 and with consideration of the Mental Capacity Act Code of Practice.
  • The company must make decisions and act in the best interests of the donor.
  • The company must take into account any restrictions and conditions set out in this LPA.
  • ", "professionalTitle": "Professional title", @@ -771,5 +771,6 @@ "enterYourCompanyPhoneNumberOptional": "Enter your company’s phone number (optional)", "youCanChooseToTellUsYourCompanyPhoneNumber": "You can choose to tell us your company’s phone number in case we ever need to contact you.", "enterYourCompanyPhoneNumberHint": "For example, 07700 900 982 or 01632 960000.", - "errorCompanyPhoneNumber": "Enter a valid phone number" + "errorCompanyPhoneNumber": "Enter a valid phone number", + "lpaNumber": "LPA number" } diff --git a/web/template/attorney_fixtures.gohtml b/web/template/attorney_fixtures.gohtml new file mode 100644 index 0000000000..7d2e7e6a91 --- /dev/null +++ b/web/template/attorney_fixtures.gohtml @@ -0,0 +1,85 @@ +{{ template "page" . }} + +{{ define "pageTitle" }}Attorney fixtures{{ end }} + +{{ define "main" }} +
    +
    +

    Attorney fixtures

    + +
    +

    Entering an email will cause a reference code to be sent and redirect you to the start page. Leave it blank to be signed in and taken to the dashboard instead.

    + {{ template "input" (input . "email" "email" "" "classes" "govuk-input--width-20" "type" "email" "spellcheck" "false" "autocomplete" "email") }} + +
    +
    + As +
    +
    + + +
    +
    + + +
    +
    +
    +
    + +
    +
    + LPA type +
    +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + Progress +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + +
    + {{ template "csrf-field" . }} +
    +
    +
    +{{ end }} diff --git a/web/template/attorney_what_happens_when_you_sign.gohtml b/web/template/attorney_what_happens_when_you_sign.gohtml index c757b9c41a..f5ec571a84 100644 --- a/web/template/attorney_what_happens_when_you_sign.gohtml +++ b/web/template/attorney_what_happens_when_you_sign.gohtml @@ -11,7 +11,7 @@ {{ if .Lpa.Type.IsHealthWelfare }} {{ if and .App.IsReplacementAttorney .App.IsTrustCorporation }} - {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentReplacementTrustCorporationPw" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.Attorneys.TrustCorporation.Name }} + {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentReplacementTrustCorporationPw" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.ReplacementAttorneys.TrustCorporation.Name }} {{ else if .App.IsTrustCorporation }} {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentTrustCorporationPw" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.Attorneys.TrustCorporation.Name }} {{ else if .App.IsReplacementAttorney }} @@ -29,7 +29,7 @@ {{ end }} {{ else }} {{ if and .App.IsReplacementAttorney .App.IsTrustCorporation }} - {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentReplacementTrustCorporationPa" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.Attorneys.TrustCorporation.Name }} + {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentReplacementTrustCorporationPa" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.ReplacementAttorneys.TrustCorporation.Name }} {{ else if .App.IsTrustCorporation }} {{ trFormatHtml .App "whatHappensWhenYouSignTheLpaContentTrustCorporationPa" "DonorFullNamePossessive" $donorFullNamePossessive "TrustCorporationName" .Lpa.Attorneys.TrustCorporation.Name }} {{ else if .App.IsReplacementAttorney }} diff --git a/web/template/fixtures.gohtml b/web/template/fixtures.gohtml index 04c03e1ff8..4e0d7e236e 100644 --- a/web/template/fixtures.gohtml +++ b/web/template/fixtures.gohtml @@ -10,7 +10,7 @@ @@ -170,97 +170,6 @@ {{ template "csrf-field" . }} -
    -

    Attorney journey

    -

    Starting this flow will send an email with reference code to the email entered below. If you don't care about seeing the email then leave the field blank.

    - -
    - {{ template "input" (input . "email" "email" "" "classes" "govuk-input--width-20" "type" "email" "spellcheck" "false" "autocomplete" "email") }} - -
    -
    - - Send email to - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - -
    -
    - - LPA type - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - -
    - -

    LPA

    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - -
    - -
    - {{ template "csrf-field" . }} -
    -

    Dashboard