From 422d023e3705884d0b65de6026f672ce4aebc986 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 30 Dec 2024 13:24:18 +0000 Subject: [PATCH 01/10] MLPAB-2692 allow changing details after a failed vouch --- cypress/e2e/donor/confirm-your-identity.cy.js | 48 +++++++++++++++++++ internal/page/fixtures/donor.go | 7 ++- web/template/donor/your_details.gohtml | 12 +++-- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/donor/confirm-your-identity.cy.js b/cypress/e2e/donor/confirm-your-identity.cy.js index 7e276a6e5c..a7b8d20c2d 100644 --- a/cypress/e2e/donor/confirm-your-identity.cy.js +++ b/cypress/e2e/donor/confirm-your-identity.cy.js @@ -5,6 +5,14 @@ describe('Confirm your identity', () => { }); it('can be completed ', () => { + cy.visitLpa("/your-details"); + + cy.contains('dt', 'First names').parent().contains('a', 'Change'); + cy.contains('dt', 'Last name').parent().contains('a', 'Change'); + cy.contains('dt', 'Date of birth').parent().contains('a', 'Change'); + + cy.contains('a', 'Return to task list').click(); + cy.contains('li', "Confirm your identity") .should('contain', 'Not started') .find('a') @@ -25,6 +33,12 @@ describe('Confirm your identity', () => { cy.contains('a', 'Return to task list').click(); cy.url().should('contain', '/task-list'); + + cy.visitLpa("/your-details"); + + cy.contains('dt', 'First names').parent().should('not.contain', 'Change'); + cy.contains('dt', 'Last name').parent().should('not.contain', 'Change'); + cy.contains('dt', 'Date of birth').parent().should('not.contain', 'Change'); }); }); @@ -254,6 +268,40 @@ describe('Confirm your identity', () => { .should('contain', 'Pending') .find('a') .click(); + + cy.visitLpa("/your-details"); + + cy.contains('dt', 'First names').parent().contains('a', 'Change'); + cy.contains('dt', 'Last name').parent().contains('a', 'Change'); + cy.contains('dt', 'Date of birth').parent().contains('a', 'Change'); }); }); + + describe('when has invited a voucher to confirm identity', () => { + beforeEach(() => { + cy.visit('/fixtures?redirect=/task-list&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&voucher=1'); + }); + + it('cannot update name or date of birth', () => { + cy.visitLpa("/your-details"); + + cy.contains('dt', 'First names').parent().should('not.contain', 'Change'); + cy.contains('dt', 'Last name').parent().should('not.contain', 'Change'); + cy.contains('dt', 'Date of birth').parent().should('not.contain', 'Change'); + }) + }) + + describe('when a voucher has been unable to vouch', () => { + beforeEach(() => { + cy.visit('/fixtures?redirect=/task-list&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&failedVouchAttempts=1'); + }); + + it('can update name and date of birth', () => { + cy.visitLpa("/your-details"); + + cy.contains('dt', 'First names').parent().should('contain', 'Change'); + cy.contains('dt', 'Last name').parent().should('contain', 'Change'); + cy.contains('dt', 'Date of birth').parent().should('contain', 'Change'); + }) + }) }); diff --git a/internal/page/fixtures/donor.go b/internal/page/fixtures/donor.go index 14155ca22b..5e6db0fc65 100644 --- a/internal/page/fixtures/donor.go +++ b/internal/page/fixtures/donor.go @@ -458,6 +458,7 @@ func updateLPAProgress( if data.Voucher == "1" { donorDetails.Voucher = makeVoucher(voucherName) donorDetails.WantVoucher = form.Yes + donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress } attempts, err := strconv.Atoi(data.FailedVouchAttempts) @@ -465,9 +466,13 @@ func updateLPAProgress( return nil, nil, fmt.Errorf("invalid value for failedVouchAttempts: %s", err.Error()) } + if attempts > 0 { + donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress + } + donorDetails.FailedVouchAttempts = attempts donorDetails.IdentityUserData = userData - if donorDetails.Tasks.ConfirmYourIdentity.IsNotStarted() { + if donorDetails.Tasks.ConfirmYourIdentity.IsNotStarted() && userData.Status.IsConfirmed() { donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateCompleted } } diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index 6622968def..aa5f7dd7a0 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -3,7 +3,9 @@ {{ define "pageTitle" }}{{ tr .App "yourDetails" }}{{ end }} {{ define "main" }} - {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown .Donor.CanChange }} + {{ $hasFailedVouch := gt .Donor.FailedVouchAttempts 0 }} + {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown }} + {{ $canChange := and (or $hasFailedVouch $hasNoIdentity) .Donor.CanChange }}
@@ -14,17 +16,17 @@ {{ template "summary-row" (summaryRow .App "firstNames" .Donor.Donor.FirstNames (fromLink .App global.Paths.YourName "#f-first-names") - .Donor.Donor.FullName $hasNoIdentity true) }} + .Donor.Donor.FullName $canChange true) }} {{ template "summary-row" (summaryRow .App "lastName" .Donor.Donor.LastName (fromLink .App global.Paths.YourName "#f-last-name") - .Donor.Donor.FullName $hasNoIdentity true) }} + .Donor.Donor.FullName $canChange true) }} {{ template "summary-row" (summaryRow .App "dateOfBirth" (formatDate .App .Donor.Donor.DateOfBirth) (fromLink .App global.Paths.YourDateOfBirth "#f-date-of-birth") - .Donor.Donor.FullName $hasNoIdentity true) }} + .Donor.Donor.FullName $canChange true) }} {{ template "address-summary-row" (summaryRow $.App "address" .Donor.Donor.Address @@ -42,7 +44,7 @@ .Donor.Donor.FullName .Donor.CanChange true) }} - {{ if not $hasNoIdentity }} + {{ if and (not $hasNoIdentity) (not $hasFailedVouch) }}

{{ tr .App "someOfTheseDetailsCanNoLongerBeChanged" }}

{{ end }} From 764b796a991388c0660729125df815003842fa12 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 30 Dec 2024 16:56:13 +0000 Subject: [PATCH 02/10] MLPAB-2692 relax conditions around Completed --- internal/page/fixtures/donor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/page/fixtures/donor.go b/internal/page/fixtures/donor.go index 5e6db0fc65..9a74ef9b10 100644 --- a/internal/page/fixtures/donor.go +++ b/internal/page/fixtures/donor.go @@ -472,7 +472,7 @@ func updateLPAProgress( donorDetails.FailedVouchAttempts = attempts donorDetails.IdentityUserData = userData - if donorDetails.Tasks.ConfirmYourIdentity.IsNotStarted() && userData.Status.IsConfirmed() { + if donorDetails.Tasks.ConfirmYourIdentity.IsNotStarted() { donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateCompleted } } From 99763b2a7e2c21eb7faac467270ceecd335026fe Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 6 Jan 2025 12:20:26 +0000 Subject: [PATCH 03/10] MLPAB-2692 fix template logic --- internal/page/fixtures/donor.go | 6 +----- web/template/donor/your_details.gohtml | 11 +++++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/internal/page/fixtures/donor.go b/internal/page/fixtures/donor.go index 9a74ef9b10..2b81a827bd 100644 --- a/internal/page/fixtures/donor.go +++ b/internal/page/fixtures/donor.go @@ -434,6 +434,7 @@ func updateLPAProgress( userData = identity.UserData{ Status: identity.StatusInsufficientEvidence, } + donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress case "expired": userData = identity.UserData{ Status: identity.StatusExpired, @@ -458,7 +459,6 @@ func updateLPAProgress( if data.Voucher == "1" { donorDetails.Voucher = makeVoucher(voucherName) donorDetails.WantVoucher = form.Yes - donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress } attempts, err := strconv.Atoi(data.FailedVouchAttempts) @@ -466,10 +466,6 @@ func updateLPAProgress( return nil, nil, fmt.Errorf("invalid value for failedVouchAttempts: %s", err.Error()) } - if attempts > 0 { - donorDetails.Tasks.ConfirmYourIdentity = task.IdentityStateInProgress - } - donorDetails.FailedVouchAttempts = attempts donorDetails.IdentityUserData = userData if donorDetails.Tasks.ConfirmYourIdentity.IsNotStarted() { diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index aa5f7dd7a0..8e11d97737 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -3,9 +3,8 @@ {{ define "pageTitle" }}{{ tr .App "yourDetails" }}{{ end }} {{ define "main" }} - {{ $hasFailedVouch := gt .Donor.FailedVouchAttempts 0 }} - {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown }} - {{ $canChange := and (or $hasFailedVouch $hasNoIdentity) .Donor.CanChange }} + {{ $vouchInProgress := and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }} + {{ $canChange := not (and (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress) .Donor.CanChange) }}
@@ -44,10 +43,14 @@ .Donor.Donor.FullName .Donor.CanChange true) }} - {{ if and (not $hasNoIdentity) (not $hasFailedVouch) }} + {{ if .Donor.IdentityUserData.Status.IsConfirmed }}

{{ tr .App "someOfTheseDetailsCanNoLongerBeChanged" }}

{{ end }} + {{ if $vouchInProgress }} +

{{ tr .App "Placeholder text to show details cannot be updated while a voucher is confirming the donor’s identity" }}

+ {{ end }} + {{ template "buttons" (button .App "continue" "link" (global.Paths.CanYouSignYourLpa.Format .App.LpaID)) }} {{ template "csrf-field" . }} From 2eac74d42195dab47b95d4e6df0895201e8de719 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 6 Jan 2025 12:33:29 +0000 Subject: [PATCH 04/10] MLPAB-2692 more template logic fixes --- web/template/donor/your_details.gohtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index 8e11d97737..91a0e2eddc 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -4,7 +4,7 @@ {{ define "main" }} {{ $vouchInProgress := and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }} - {{ $canChange := not (and (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress) .Donor.CanChange) }} + {{ $canChange := and .Donor.CanChange (not (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress)) }}
From d2e26aaccbd18729385000f191d4dc451702feaf Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 6 Jan 2025 14:19:34 +0000 Subject: [PATCH 05/10] MLPAB-2692 fix e2e --- cypress/e2e/donor/what-you-can-do-now.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/donor/what-you-can-do-now.cy.js b/cypress/e2e/donor/what-you-can-do-now.cy.js index b71f700b96..d0e27238da 100644 --- a/cypress/e2e/donor/what-you-can-do-now.cy.js +++ b/cypress/e2e/donor/what-you-can-do-now.cy.js @@ -44,7 +44,7 @@ describe('what you can do now', () => { cy.url().should('contain', '/task-list') cy.checkA11yApp() - cy.contains('li', "Confirm your identity").should('contain', 'Completed').click(); + cy.contains('li', "Confirm your identity").should('contain', 'In progress').click(); cy.url().should('contain', '/what-happens-next-registering-with-court-of-protection') cy.checkA11yApp() From f5493d28b7457c459bba19c9c27513c52a835518 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 6 Jan 2025 16:06:10 +0000 Subject: [PATCH 06/10] MLPAB-2692 replace CanChange checks with SignedAt.IsZero checks --- go.sum | 94 +------------------ internal/donor/donorpage/identity_details.go | 2 +- internal/donor/store.go | 2 +- web/template/donor/check_your_details.gohtml | 4 +- web/template/donor/check_your_lpa.gohtml | 4 +- .../donor/choose_attorneys_summary.gohtml | 2 +- .../choose_people_to_notify_summary.gohtml | 2 +- ...hoose_replacement_attorneys_summary.gohtml | 2 +- web/template/donor/identity_details.gohtml | 12 +-- web/template/donor/your_details.gohtml | 8 +- .../layout/changeable-contextual-lpa.gohtml | 2 +- 11 files changed, 21 insertions(+), 113 deletions(-) diff --git a/go.sum b/go.sum index cd72928105..95db8e169b 100644 --- a/go.sum +++ b/go.sum @@ -4,110 +4,60 @@ github.com/MicahParks/keyfunc/v3 v3.3.5 h1:7ceAJLUAldnoueHDNzF8Bx06oVcQ5CfJnYwNt github.com/MicahParks/keyfunc/v3 v3.3.5/go.mod h1:SdCCyMJn/bYqWDvARspC6nCT8Sk74MjuAY22C7dCST8= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= -github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= -github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= -github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= -github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= github.com/aws/aws-sdk-go-v2/config v1.28.7 h1:GduUnoTXlhkgnxTD93g1nv4tVPILbdNQOzav+Wpg7AE= github.com/aws/aws-sdk-go-v2/config v1.28.7/go.mod h1:vZGX6GVkIE8uECSUHB6MWAUsd4ZcG2Yq/dMa4refR3M= -github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= -github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4afs45mOWEI+MzZtTfQ= github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.20 h1:bwHhhCScKRAYJtaWVT+jDpt74GybN2nxI6+InkRjqGM= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.20/go.mod h1:/RfYH8CUMQuq/3CIEVGHLkqkA9KtbBF5omt2Ae8xc0s= github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.22 h1:p2LDiYhvM9mMExEY1meHMAmjmVlzD1J1jVG+fGut+mE= github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.22/go.mod h1:fo5T2fYMHVF2rHrym50h7Ue/+SECRJlUHUFZLjSX18g= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 h1:AmoU1pziydclFT/xRV+xXE/Vb8fttJCLRPv8oAkprc0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21/go.mod h1:AjUdLYe4Tgs6kpH4Bv7uMZo7pottoyHMn4eTcIcneaY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 h1:r67ps7oHCYnflpgDy2LZU0MAQtQbYIOqNNnqGO6xQkE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25/go.mod h1:GrGY+Q4fIokYLtjCVB/aFfCVL6hhGUFl8inD18fDalE= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.43.3 h1:nQLG9irjDGUFXVPDHzjCGEEwh0hZ6BcxTvHOod1YsP4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.43.3/go.mod h1:URs8sqsyaxiAZkKP6tOEmhcs9j2ynFIomqOKY/CAHJc= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.43.4 h1:nv6UzNfGzyq/nNXwk2mH8PCmcC+5oAt+L7OETT2U0CE= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.43.4/go.mod h1:aBk4XbmWf8p4N15l6DPVgb2t/n5gpk+mZMbigYV3a1Y= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0 h1:isKhHsjpQR3CypQJ4G1g8QWx7zNpiC/xKw1zjgJYVno= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0/go.mod h1:xDvUyIkwBwNtVZJdHEwAuhFly3mezwdEWkbJ5oNYwIw= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.1 h1:AnSNs7Ogi0LXHPMDBx4RE7imU4/JmzWFziqkMKJA2AY= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.1/go.mod h1:J8xqRbx7HIc8ids2P8JbrKx9irONPEYq7Z1FpLDpi3I= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.8 h1:ntqHwZb+ZyVz0CFYUG0sQ02KMMJh+iXeV3bXoba+s4A= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.8/go.mod h1:Hcjb2SiUo9v1GhpXjRNW7hAwfzAPfrsgnlKpP5UYEPY= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.10 h1:aWEbNPNdGiTGSR6/Yy9S0Ad07sMVaT/CFaVq7GuDGx4= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.24.10/go.mod h1:HywkMgYwY0uaybPvvctx6fkm3L1ssRKeGv7TPZ6OQ/M= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.0 h1:UBCwgevYbPDbPb8LKyCmyBJ0Lk/gCPq4v85rZLe3vr4= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.0/go.mod h1:ve9wzd6ToYjkZrF0nesNJxy14kU77QjrH5Rixrr4NJY= github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.1 h1:T/X6qqOleh63LMUt90FkdQ9dBKTFvogsRlrk0dkCFww= github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.1/go.mod h1:pd8aAX/C3BSJ4Y0PSF8KoOpXFP6p511Uu2PObSdhW/Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6 h1:HCpPsWqmYQieU7SS6E9HXfdAMSud0pteVXieJmcpIRI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6/go.mod h1:ngUiVRCco++u+soRRVBIvBZxSMMvOVMXA4PJ36JLfSw= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.6 h1:nbmKXZzXPJn41CcD4HsHsGWqvKjLKz9kWu6XxvLmf1s= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.6/go.mod h1:SJhcisfKfAawsdNQoZMBEjg+vyN2lH6rO6fP+T94z5Y= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.7 h1:EqGlayejoCRXmnVC6lXl6phCm9R2+k35e0gWsO9G5DI= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.7/go.mod h1:BTw+t+/E5F3ZnDai/wSOYM54WUVjSdewE7Jvwtb7o+w= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 h1:BbGDtTi0T1DYlmjBiCr/le3wzhA37O8QTC5/Ab8+EXk= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6/go.mod h1:hLMJt7Q8ePgViKupeymbqI0la+t9/iYFBjxQCFwuAwI= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 h1:nyuzXooUNJexRT0Oy0UQY6AhOzxPxhtt4DcBIHyCnmw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0/go.mod h1:sT/iQz8JK3u/5gZkT+Hmr7GzVZehUMkRZpOaAwYXeGY= github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= -github.com/aws/aws-sdk-go-v2/service/s3control v1.52.0 h1:tH6HJdKj1O5N8Uti8D2X20JYoDe9ZdC827iY92U+Ooo= -github.com/aws/aws-sdk-go-v2/service/s3control v1.52.0/go.mod h1:sAOVMYapLSs3nCfdQo63qfVkKHlu97oqHDPrRbqayNg= github.com/aws/aws-sdk-go-v2/service/s3control v1.52.1 h1:xxGbXbGtO/VMz2JqB1UwEDlSchryUss0KmQJSZ0oTUE= github.com/aws/aws-sdk-go-v2/service/s3control v1.52.1/go.mod h1:6BuUa52of67a+ri/poTH82XiL+rTGQWUPZCmf2cfVHI= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.7 h1:Nyfbgei75bohfmZNxgN27i528dGYVzqWJGlAO6lzXy8= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.7/go.mod h1:FG4p/DciRxPgjA+BEOlwRHN0iA8hX2h9g5buSy3cTDA= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.8 h1:WT3EPriVEpHE2jeNqHqj7l43JCIWPoZjNNRluZ7agII= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.8/go.mod h1:By/yiMzR0yfhPaqRWE3GrT9B/Z6871z1GfWGc+vf4Y8= github.com/aws/aws-sdk-go-v2/service/sns v1.33.7 h1:N3o8mXK6/MP24BtD9sb51omEO9J9cgPM3Ughc293dZc= github.com/aws/aws-sdk-go-v2/service/sns v1.33.7/go.mod h1:AAHZydTB8/V2zn3WNwjLXBK1RAcSEpDNmFfrmjvrJQg= -github.com/aws/aws-sdk-go-v2/service/sqs v1.37.2 h1:mFLfxLZB/TVQwNJAYox4WaxpIu+dFVIcExrmRmRCOhw= -github.com/aws/aws-sdk-go-v2/service/sqs v1.37.2/go.mod h1:GnvfTdlvcpD+or3oslHPOn4Mu6KaCwlCp+0p0oqWnrM= -github.com/aws/aws-sdk-go-v2/service/sqs v1.37.3 h1:94lmK3kN/iRSHrvWt+JujIqjVE53v0wrQ1lbPTmg6gM= -github.com/aws/aws-sdk-go-v2/service/sqs v1.37.3/go.mod h1:171mrsbgz6DahPMnLJzQiH3bXXrdsWhpE9USZiM19Lk= github.com/aws/aws-sdk-go-v2/service/sqs v1.37.4 h1:WpoMCoS4+qOkkuWQommvDRboKYzK91En6eXO/k5dXr0= github.com/aws/aws-sdk-go-v2/service/sqs v1.37.4/go.mod h1:171mrsbgz6DahPMnLJzQiH3bXXrdsWhpE9USZiM19Lk= -github.com/aws/aws-sdk-go-v2/service/ssm v1.56.1 h1:cfVjoEwOMOJOI6VoRQua0nI0KjZV9EAnR8bKaMeSppE= -github.com/aws/aws-sdk-go-v2/service/ssm v1.56.1/go.mod h1:fGHwAnTdNrLKhgl+UEeq9uEL4n3Ng4MJucA+7Xi3sC4= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.2 h1:MOxvXH2kRP5exvqJxAZ0/H9Ar51VmADJh95SgZE8u60= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.2/go.mod h1:RKWoqC9FlgMCkrfVOtgfqfwdaUIaq8H93UAt4xNaR0A= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7/go.mod h1:JfyQ0g2JG8+Krq0EuZNnRwX0mU0HrwY/tG6JNfcqh4k= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 h1:Xgv/hyNgvLda/M9l9qxXc4UFSgppnRczLxlMs5Ae/QY= github.com/aws/aws-sdk-go-v2/service/sts v1.33.3/go.mod h1:5Gn+d+VaaRgsjewpMvGazt0WfcFO+Md4wLOuBfGR9Bc= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= @@ -156,8 +106,6 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -191,8 +139,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/ministryofjustice/opg-go-common v1.41.0 h1:IUNeuENR76VrW9x4+bWY+KzuJmzil4fU03XOr765uQg= -github.com/ministryofjustice/opg-go-common v1.41.0/go.mod h1:ChMNWq0LXn5CexlllRmuMxiWlCcIB0+msrPNJ8mXktQ= github.com/ministryofjustice/opg-go-common v1.62.0 h1:dpULKPm4Tru7NwsRNTkklhXn21MgOUniWyyR4KZxnYY= github.com/ministryofjustice/opg-go-common v1.62.0/go.mod h1:ChMNWq0LXn5CexlllRmuMxiWlCcIB0+msrPNJ8mXktQ= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -254,9 +200,7 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/vektra/mockery/v2 v2.50.0 h1:0GYRH38nKiRghwUq+0aJXG1sT3yyTYj/J1xQRM8kGzQ= -github.com/vektra/mockery/v2 v2.50.0/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= -github.com/vektra/mockery/v2 v2.50.1/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= +github.com/vektra/mockery/v2 v2.50.3 h1:6Q0774Uaz8SQ+ynPeP4xdDfgj+3VQIG5hfmM4mlYCGk= github.com/vektra/mockery/v2 v2.50.3/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= github.com/wI2L/jsondiff v0.6.0 h1:zrsH3FbfVa3JO9llxrcDy/XLkYPLgoMX6Mz3T2PP2AI= github.com/wI2L/jsondiff v0.6.0/go.mod h1:D6aQ5gKgPF9g17j+E9N7aasmU1O+XvfmWm1y8UMmNpw= @@ -268,60 +212,32 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/detectors/aws/ecs v1.32.0 h1:B/miSe8J7Jl669Qitisp7qF+ZHf6e512jSVvEW9ZR9E= -go.opentelemetry.io/contrib/detectors/aws/ecs v1.32.0/go.mod h1:5ZG7LhkAhDjg5ugF75iJinsM8s4zaHRV6eyJokqiSSg= go.opentelemetry.io/contrib/detectors/aws/ecs v1.33.0 h1:hQutFWRAsJcAB5RsKoCfGLTlF5g2FZUPa4ID+YyqrkA= go.opentelemetry.io/contrib/detectors/aws/ecs v1.33.0/go.mod h1:UtKgZeFznLD+ttVFE6gZ4wVcM/qyQGMYgSW5fqq71NA= -go.opentelemetry.io/contrib/detectors/aws/lambda v0.57.0 h1:98NbH2n0x8KCgwuVwaPGIJplHgDzCxW96lH/LoytUfo= -go.opentelemetry.io/contrib/detectors/aws/lambda v0.57.0/go.mod h1:VPaITUzB2cgYvVhbNxNfUO/NZ9La4n3oD/vRITua9YU= go.opentelemetry.io/contrib/detectors/aws/lambda v0.58.0 h1:H/c3HZqlcWp4oX0DwxEANrId6KjRAueRPEcelatqJdI= go.opentelemetry.io/contrib/detectors/aws/lambda v0.58.0/go.mod h1:A/ZQKjsIrDGLKa/4S1eKe3/VdvHwllo8I+FY1fPE1lI= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.57.0 h1:Kfc8eBesTRYFLR+Zgp/C0vRexWhW/lEFAh/JpNiyNMM= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.57.0/go.mod h1:l6KL74MKICQrcIWxQCgy9nMUTi2VZ+Me9TGhihk71e4= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.58.0 h1:QfTpKKkC4BvHdJ9oFoM+Z89d5WhpJ9tlG2g9sysz7F8= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.58.0/go.mod h1:AHgeN3nxgdMk3Zbyh7lNPcUIN+rTvuO26MAIKSJJcAw= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.57.0 h1:YsNExbrbUFoq1w2th+SFnthVJbZS4VuN7RwmoNYh9i0= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.57.0/go.mod h1:ir9tQhzlduhcHfCQPOy3xrTVugswfAxIFvHIGPFvVzU= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.58.0 h1:JK3+tZZsXOjQMDbD3auqJMBl8Ygjqj6GL6FdskMxZw8= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.58.0/go.mod h1:U4U5hkYpN8fduJNfF0qZjW2icq2nVz7wc4GWunhaHF4= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.57.0 h1:G47XgH32CEM1I9kZ8xrVExSxivATGHNE0tdxuqlx9MQ= -go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.57.0/go.mod h1:aqXlYGrumc8b/n4z9eDHHoiLN4fq2DAO//wMnqdxPhg= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.58.0 h1:g2rorZw2f1qnyfLOC7FP99argIWsN708Fjs2Zwz6SOk= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.58.0/go.mod h1:QzTypGPlQn4NselMPALVKGwm/p3XKLVCB/UG2Dq3PxQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/contrib/propagators/aws v1.32.0 h1:NELzr8bW7a7aHVZj5gaep1PfkvoSCGx+1qNGZx/uhhU= -go.opentelemetry.io/contrib/propagators/aws v1.32.0/go.mod h1:XKMrzHNka3eOA+nGEcNKYVL9s77TAhkwQEynYuaRFnQ= go.opentelemetry.io/contrib/propagators/aws v1.33.0 h1:MefPfPIut0IxEiQRK1qVv5AFADBOwizl189+m7QhpFg= go.opentelemetry.io/contrib/propagators/aws v1.33.0/go.mod h1:VB6xPo12uW/PezOqtA/cY2/DiAGYshnhID606wC9NEY= -go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= -go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 h1:IJFEoHiytixx8cMiVAO+GmHR6Frwu+u5Ur8njpFO6Ac= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0/go.mod h1:3rHrKNtLIoS0oZwkY2vxi+oJcwFRWdtUyRII+so45p8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 h1:9kV11HXBHZAvuPUZxmMWrH8hZn/6UnHX4K0mu36vNsU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0/go.mod h1:JyA0FHXe22E1NeNiHmVp7kFHglnexDQ7uRWDiiJ1hKQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 h1:5pojmb1U1AogINhN3SurB+zm/nIcusopeBNp42f45QM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0/go.mod h1:57gTHJSE5S1tqg+EKsLPlTWhpHMsWlVmer+LA926XiA= -go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= -go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= -go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM= -go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= -go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= -go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg= go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -350,20 +266,12 @@ golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/donor/donorpage/identity_details.go b/internal/donor/donorpage/identity_details.go index 15d641885f..094ec95034 100644 --- a/internal/donor/donorpage/identity_details.go +++ b/internal/donor/donorpage/identity_details.go @@ -43,7 +43,7 @@ func IdentityDetails(tmpl template.Template, donorStore DonorStore) Handler { AddressMatch: provided.Donor.Address.Postcode == provided.IdentityUserData.CurrentAddress.Postcode, } - if r.Method == http.MethodPost && provided.CanChange() { + if r.Method == http.MethodPost && provided.SignedAt.IsZero() { f := form.ReadYesNoForm(r, "yesIfWouldLikeToUpdateDetails") data.Errors = f.Validate() diff --git a/internal/donor/store.go b/internal/donor/store.go index faa7273dcd..c86e4a62cb 100644 --- a/internal/donor/store.go +++ b/internal/donor/store.go @@ -341,7 +341,7 @@ func (s *Store) Put(ctx context.Context, donor *donordata.Provided) error { } appData := appcontext.DataFromContext(ctx) - if appData.IsDonor() && !donor.CanChange() && donor.CheckedHashChanged() { + if appData.IsDonor() && !donor.SignedAt.IsZero() && donor.CheckedHashChanged() { return errors.New("donor tried to change a signed LPA") } diff --git a/web/template/donor/check_your_details.gohtml b/web/template/donor/check_your_details.gohtml index 70d3dd0ac1..a274a5114c 100644 --- a/web/template/donor/check_your_details.gohtml +++ b/web/template/donor/check_your_details.gohtml @@ -3,7 +3,7 @@ {{ define "pageTitle" }}{{ tr .App "checkYourDetails" }}{{ end }} {{ define "main" }} - {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown .Donor.CanChange }} + {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown .Donor.SignedAt.IsZero }}
@@ -24,7 +24,7 @@ {{ template "address-summary-row" (summaryRow .App "address" .Donor.Donor.Address (fromLink .App global.Paths.YourAddress "#f-address-line-1") - "" .Donor.CanChange true + "" .Donor.SignedAt.IsZero true ) }} diff --git a/web/template/donor/check_your_lpa.gohtml b/web/template/donor/check_your_lpa.gohtml index 4b945269d8..ec38f342f8 100644 --- a/web/template/donor/check_your_lpa.gohtml +++ b/web/template/donor/check_your_lpa.gohtml @@ -15,13 +15,13 @@ {{ tr .App "lpaDecisions" }} - {{ template "lpa-decisions" (lpaDecisions .App .Donor .Donor.CanChange) }} + {{ template "lpa-decisions" (lpaDecisions .App .Donor .Donor.SignedAt.IsZero) }}

{{ tr .App "peopleNamedOnTheLpa" }}

- {{ template "people-named-on-lpa" (lpaDecisions .App .Donor .Donor.CanChange) }} + {{ template "people-named-on-lpa" (lpaDecisions .App .Donor .Donor.SignedAt.IsZero) }} {{ if .CanContinue }}
diff --git a/web/template/donor/choose_attorneys_summary.gohtml b/web/template/donor/choose_attorneys_summary.gohtml index 7249cdd012..a14c71660f 100644 --- a/web/template/donor/choose_attorneys_summary.gohtml +++ b/web/template/donor/choose_attorneys_summary.gohtml @@ -7,7 +7,7 @@

{{ trCount .App "attorneysAdded" .Donor.Attorneys.Len }}

- {{ template "attorney-summary" (listAttorneys .App .Donor.Attorneys "attorney" 2 .Donor.CanChange) }} + {{ template "attorney-summary" (listAttorneys .App .Donor.Attorneys "attorney" 2 .Donor.SignedAt.IsZero) }} {{ template "radios-fieldset" (fieldset . .Form.FieldName "" diff --git a/web/template/donor/choose_people_to_notify_summary.gohtml b/web/template/donor/choose_people_to_notify_summary.gohtml index 711c8f836f..63bc87e514 100644 --- a/web/template/donor/choose_people_to_notify_summary.gohtml +++ b/web/template/donor/choose_people_to_notify_summary.gohtml @@ -9,7 +9,7 @@ {{ trHtml .App "weCanNotifyUpTo5PeopleContent" }} - {{ template "people-to-notify-summary" (listPeopleToNotify .App .Donor.PeopleToNotify 2 .Donor.CanChange) }} + {{ template "people-to-notify-summary" (listPeopleToNotify .App .Donor.PeopleToNotify 2 .Donor.SignedAt.IsZero) }} {{ if eq 5 (len .Donor.PeopleToNotify) }} {{ template "information-banner" (content .App "addedMaxPeople") }} diff --git a/web/template/donor/choose_replacement_attorneys_summary.gohtml b/web/template/donor/choose_replacement_attorneys_summary.gohtml index 16518fa03f..061d81cde8 100644 --- a/web/template/donor/choose_replacement_attorneys_summary.gohtml +++ b/web/template/donor/choose_replacement_attorneys_summary.gohtml @@ -7,7 +7,7 @@

{{ trCount .App "replacementAttorneysAdded" .Donor.ReplacementAttorneys.Len }}

- {{ template "attorney-summary" (listAttorneys .App .Donor.ReplacementAttorneys "replacement" 2 .Donor.CanChange) }} + {{ template "attorney-summary" (listAttorneys .App .Donor.ReplacementAttorneys "replacement" 2 .Donor.SignedAt.IsZero) }} {{ template "radios-fieldset" (fieldset . .Form.FieldName "" diff --git a/web/template/donor/identity_details.gohtml b/web/template/donor/identity_details.gohtml index 53858e4d6a..5b76ed68c9 100644 --- a/web/template/donor/identity_details.gohtml +++ b/web/template/donor/identity_details.gohtml @@ -14,7 +14,7 @@ {{ if not .Provided.WantVoucher.IsYes }} {{ template "notification-banner" (notificationBanner .App "success" (trHtml .App "youHaveSuccessfullyConfirmedYourIdentitySuccess:donor") "success" "contents" ) }} {{ end }} - {{ else if .Provided.CanChange }} + {{ else if .Provided.SignedAt.IsZero }} {{ template "warning-banner" (content .App "someDetailsDoNotMatchIdentityDetailsWarning") }} {{ else }} {{ template "notification-banner" (notificationBanner .App "important" (trHtml .App "theDetailsOnYourLpaDoNotMatch") "heading") }} @@ -66,18 +66,18 @@
{{ end }} - + {{ template "identity-details" (card .App .Provided.IdentityUserData) }} - {{ if not .Provided.CanChange }} + {{ if not .Provided.SignedAt.IsZero }}

{{ tr .App "whatHappensNext" }}

- + {{ trHtml .App "theDetailsOnYourLpaCannotBeUpdatedAsSigned" }} {{ template "warning" (content .App "ifYouDoNotWantRegisteredWithConfirmedDetailsWarning") }} {{ end }} - - {{ if or .DetailsMatch (not .Provided.CanChange) }} + + {{ if or .DetailsMatch (not .Provided.SignedAt.IsZero) }} {{ template "button" (button .App "returnToTaskList" "link" (global.Paths.TaskList.Format .Provided.LpaID)) }} {{ else }} diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index 91a0e2eddc..d8bc172d88 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -4,7 +4,7 @@ {{ define "main" }} {{ $vouchInProgress := and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }} - {{ $canChange := and .Donor.CanChange (not (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress)) }} + {{ $canChange := and .Donor.SignedAt.IsZero (not (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress)) }}
@@ -30,17 +30,17 @@ {{ template "address-summary-row" (summaryRow $.App "address" .Donor.Donor.Address (fromLink .App global.Paths.YourAddress "#f-address-line-1") - .Donor.Donor.FullName .Donor.CanChange true) }} + .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} {{ template "summary-row" (summaryRow .App "email" .Donor.Donor.Email (fromLink .App global.Paths.YourEmail "#f-email") - .Donor.Donor.FullName .Donor.CanChange true) }} + .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} {{ template "summary-row" (summaryRow .App "mobile" .Donor.Donor.Mobile (fromLink .App global.Paths.YourMobile "#f-mobile") - .Donor.Donor.FullName .Donor.CanChange true) }} + .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} {{ if .Donor.IdentityUserData.Status.IsConfirmed }} diff --git a/web/template/layout/changeable-contextual-lpa.gohtml b/web/template/layout/changeable-contextual-lpa.gohtml index a53ebd2d36..2082bbad7b 100644 --- a/web/template/layout/changeable-contextual-lpa.gohtml +++ b/web/template/layout/changeable-contextual-lpa.gohtml @@ -2,7 +2,7 @@ {{ $donorFullName := .Donor.Donor.FullName }} {{ $isPropertyAndAffairs := .Donor.Type.IsPropertyAndAffairs }} {{ $isDonor := .App.IsDonor }} - {{ $canChange := and $isDonor .Donor.CanChange }} + {{ $canChange := and $isDonor .Donor.SignedAt.IsZero }} {{ $canChangePersonalDetails := and .Donor.IdentityUserData.Status.IsUnknown $canChange }} {{ template "contextual-lpa-warning" . }} From f627809ad65ccf44ae6d3fe13a82bc2aa6eb6153 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Mon, 6 Jan 2025 16:58:36 +0000 Subject: [PATCH 07/10] MLPAB-2692 centralise canChangePersonalDetails logic in Provided --- cypress/parallel-weights.json | 2 +- internal/donor/donordata/provided.go | 11 +++-- internal/donor/donordata/provided_test.go | 42 +++++++++++++++++-- web/template/donor/your_details.gohtml | 11 ++--- .../layout/changeable-contextual-lpa.gohtml | 2 +- 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/cypress/parallel-weights.json b/cypress/parallel-weights.json index d40887e5af..b57a4fbe82 100644 --- a/cypress/parallel-weights.json +++ b/cypress/parallel-weights.json @@ -1 +1 @@ -{"cypress/e2e/accessibility/data-loss-warning.cy.js":{"time":2779,"weight":4},"cypress/e2e/attorney/confirm-your-details.cy.js":{"time":1488,"weight":2},"cypress/e2e/attorney/language-preferences.cy.js":{"time":2843,"weight":5},"cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js":{"time":738,"weight":1},"cypress/e2e/attorney/opt-out.cy.js":{"time":1771,"weight":3},"cypress/e2e/attorney/phone-number.cy.js":{"time":2083,"weight":3},"cypress/e2e/attorney/progress.cy.js":{"time":3098,"weight":5},"cypress/e2e/attorney/read-the-lpa.cy.js":{"time":904,"weight":1},"cypress/e2e/attorney/sign.cy.js":{"time":3874,"weight":6},"cypress/e2e/attorney/start.cy.js":{"time":244,"weight":0},"cypress/e2e/attorney/task-list.cy.js":{"time":836,"weight":1},"cypress/e2e/attorney/trust-corporation.cy.js":{"time":12475,"weight":22},"cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js":{"time":1220,"weight":2},"cypress/e2e/certificate-provider/certificate-provided.cy.js":{"time":2216,"weight":3},"cypress/e2e/certificate-provider/choose-not-to-be-a-certificate-provider.cy.js":{"time":2303,"weight":4},"cypress/e2e/certificate-provider/confirm-your-details.cy.js":{"time":4781,"weight":8},"cypress/e2e/certificate-provider/confirm-your-identity.cy.js":{"time":5471,"weight":9},"cypress/e2e/certificate-provider/enter-date-of-birth.cy.js":{"time":6964,"weight":12},"cypress/e2e/certificate-provider/enter-reference-number.cy.js":{"time":4311,"weight":7},"cypress/e2e/certificate-provider/language-preferences.cy.js":{"time":2183,"weight":3},"cypress/e2e/certificate-provider/provide-certificate.cy.js":{"time":2456,"weight":4},"cypress/e2e/certificate-provider/read-the-lpa.cy.js":{"time":1617,"weight":2},"cypress/e2e/certificate-provider/start.cy.js":{"time":333,"weight":0},"cypress/e2e/certificate-provider/task-list.cy.js":{"time":670,"weight":1},"cypress/e2e/certificate-provider/what-is-your-home-address.cy.js":{"time":8871,"weight":15},"cypress/e2e/certificate-provider/who-is-eligible.cy.js":{"time":759,"weight":1},"cypress/e2e/dev-features.cy.js":{"time":320,"weight":0},"cypress/e2e/donor/add-correspondent.cy.js":{"time":6344,"weight":11},"cypress/e2e/donor/can-you-sign-your-lpa.cy.js":{"time":1002,"weight":1},"cypress/e2e/donor/certificate-provider.cy.js":{"time":16909,"weight":30},"cypress/e2e/donor/check-your-details.cy.js":{"time":2589,"weight":4},"cypress/e2e/donor/check-your-lpa.cy.js":{"time":10535,"weight":18},"cypress/e2e/donor/choose-attorneys-address.cy.js":{"time":10026,"weight":17},"cypress/e2e/donor/choose-attorneys-summary.cy.js":{"time":7724,"weight":13},"cypress/e2e/donor/choose-attorneys-task.cy.js":{"time":16572,"weight":29},"cypress/e2e/donor/choose-attorneys.cy.js":{"time":10799,"weight":19},"cypress/e2e/donor/choose-people-to-notify-address.cy.js":{"time":4323,"weight":7},"cypress/e2e/donor/choose-replacement-attorneys-address.cy.js":{"time":8581,"weight":15},"cypress/e2e/donor/choose-replacement-attorneys-summary.cy.js":{"time":7142,"weight":12},"cypress/e2e/donor/choose-replacement-attorneys-task.cy.js":{"time":110110,"weight":197},"cypress/e2e/donor/choose-replacement-attorneys.cy.js":{"time":12156,"weight":21},"cypress/e2e/donor/confirm-person-allowed-to-vouch.cy.js":{"time":3787,"weight":6},"cypress/e2e/donor/confirm-your-certificate-provider-is-not-related.cy.js":{"time":2370,"weight":4},"cypress/e2e/donor/confirm-your-identity-and-sign.cy.js":{"time":19599,"weight":35},"cypress/e2e/donor/dashboard.cy.js":{"time":5604,"weight":10},"cypress/e2e/donor/delete-lpa.cy.js":{"time":2573,"weight":4},"cypress/e2e/donor/enter-access-code.cy.js":{"time":1133,"weight":2},"cypress/e2e/donor/enter-replacement-trust-corporation-address.cy.js":{"time":9543,"weight":17},"cypress/e2e/donor/enter-replacement-trust-corporation.cy.js":{"time":2787,"weight":4},"cypress/e2e/donor/enter-trust-corporation-address.cy.js":{"time":9941,"weight":17},"cypress/e2e/donor/enter-trust-corporation.cy.js":{"time":2438,"weight":4},"cypress/e2e/donor/enter-voucher.cy.js":{"time":3405,"weight":6},"cypress/e2e/donor/how-should-attorneys-make-decisions.cy.js":{"time":3124,"weight":5},"cypress/e2e/donor/how-should-replacement-attorneys-make-decisions.cy.js":{"time":2809,"weight":5},"cypress/e2e/donor/how-should-replacement-attorneys-step-in.cy.js":{"time":2299,"weight":4},"cypress/e2e/donor/language-preferences.cy.js":{"time":937,"weight":1},"cypress/e2e/donor/life-sustaining-treatment.cy.js":{"time":1509,"weight":2},"cypress/e2e/donor/lpa-progress.cy.js":{"time":2331,"weight":4},"cypress/e2e/donor/lpa-type.cy.js":{"time":3416,"weight":6},"cypress/e2e/donor/make-a-new-lpa.cy.js":{"time":4946,"weight":8},"cypress/e2e/donor/payment.cy.js":{"time":24859,"weight":44},"cypress/e2e/donor/people-to-notify.cy.js":{"time":10220,"weight":18},"cypress/e2e/donor/previous-application-number.cy.js":{"time":2086,"weight":3},"cypress/e2e/donor/provide-your-details.cy.js":{"time":4771,"weight":8},"cypress/e2e/donor/remove-replacement-trust-corporation.cy.js":{"time":1170,"weight":2},"cypress/e2e/donor/remove-trust-corporation.cy.js":{"time":1118,"weight":2},"cypress/e2e/donor/restrictions.cy.js":{"time":758,"weight":1},"cypress/e2e/donor/signing-on-behalf.cy.js":{"time":3791,"weight":6},"cypress/e2e/donor/start.cy.js":{"time":525,"weight":0},"cypress/e2e/donor/task-list.cy.js":{"time":388,"weight":0},"cypress/e2e/donor/want-replacement-attorneys.cy.js":{"time":3117,"weight":5},"cypress/e2e/donor/what-is-vouching.cy.js":{"time":645,"weight":1},"cypress/e2e/donor/what-you-can-do-now.cy.js":{"time":7979,"weight":14},"cypress/e2e/donor/when-can-the-lpa-be-used.cy.js":{"time":1341,"weight":2},"cypress/e2e/donor/withdraw-lpa.cy.js":{"time":1309,"weight":2},"cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js":{"time":3047,"weight":5},"cypress/e2e/donor/your-address.cy.js":{"time":8367,"weight":14},"cypress/e2e/donor/your-authorised-signatory.cy.js":{"time":2151,"weight":3},"cypress/e2e/donor/your-date-of-birth.cy.js":{"time":4491,"weight":8},"cypress/e2e/donor/your-independent-witness-address.cy.js":{"time":10224,"weight":18},"cypress/e2e/donor/your-independent-witness-mobile.cy.js":{"time":2077,"weight":3},"cypress/e2e/donor/your-independent-witness.cy.js":{"time":2018,"weight":3},"cypress/e2e/donor/your-name.cy.js":{"time":2438,"weight":4},"cypress/e2e/error-pages.cy.js":{"time":1334,"weight":2},"cypress/e2e/navigation.cy.js":{"time":801,"weight":1},"cypress/e2e/supporter/add-correspondent.cy.js":{"time":13377,"weight":23},"cypress/e2e/supporter/dashboard.cy.js":{"time":12647,"weight":22},"cypress/e2e/supporter/donor-access.cy.js":{"time":4560,"weight":8},"cypress/e2e/supporter/edit-member.cy.js":{"time":8660,"weight":15},"cypress/e2e/supporter/enter-organisation-name.cy.js":{"time":1581,"weight":2},"cypress/e2e/supporter/invite-member.cy.js":{"time":4497,"weight":8},"cypress/e2e/supporter/manage-organisation.cy.js":{"time":5119,"weight":9},"cypress/e2e/supporter/manage-team-members.cy.js":{"time":1987,"weight":3},"cypress/e2e/supporter/start.cy.js":{"time":1436,"weight":2},"cypress/e2e/supporter/suspended.cy.js":{"time":430,"weight":0},"cypress/e2e/supporter/view-lpa.cy.js":{"time":5841,"weight":10},"cypress/e2e/voucher/confirm-your-identity.cy.js":{"time":5545,"weight":9},"cypress/e2e/voucher/confirm-your-name.cy.js":{"time":4410,"weight":7},"cypress/e2e/voucher/enter-reference-number.cy.js":{"time":3826,"weight":6},"cypress/e2e/voucher/verify-donor-details.cy.js":{"time":742,"weight":1},"cypress/e2e/voucher/your-declaration.cy.js":{"time":831,"weight":1}} +{"cypress/e2e/accessibility/data-loss-warning.cy.js":{"time":2788,"weight":5},"cypress/e2e/attorney/confirm-your-details.cy.js":{"time":5753,"weight":10},"cypress/e2e/attorney/language-preferences.cy.js":{"time":1248,"weight":2},"cypress/e2e/attorney/legal-rights-and-responsibilities.cy.js":{"time":426,"weight":0},"cypress/e2e/attorney/opt-out.cy.js":{"time":1309,"weight":2},"cypress/e2e/attorney/phone-number.cy.js":{"time":1925,"weight":3},"cypress/e2e/attorney/progress.cy.js":{"time":1458,"weight":2},"cypress/e2e/attorney/read-the-lpa.cy.js":{"time":545,"weight":0},"cypress/e2e/attorney/sign.cy.js":{"time":3794,"weight":6},"cypress/e2e/attorney/start.cy.js":{"time":175,"weight":0},"cypress/e2e/attorney/task-list.cy.js":{"time":499,"weight":0},"cypress/e2e/attorney/trust-corporation.cy.js":{"time":13500,"weight":24},"cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js":{"time":1459,"weight":2},"cypress/e2e/certificate-provider/certificate-provided.cy.js":{"time":1200,"weight":2},"cypress/e2e/certificate-provider/choose-not-to-be-a-certificate-provider.cy.js":{"time":2382,"weight":4},"cypress/e2e/certificate-provider/confirm-your-details.cy.js":{"time":4867,"weight":8},"cypress/e2e/certificate-provider/confirm-your-identity.cy.js":{"time":5460,"weight":9},"cypress/e2e/certificate-provider/dashboard.cy.js":{"time":1224,"weight":2},"cypress/e2e/certificate-provider/enter-date-of-birth.cy.js":{"time":6545,"weight":11},"cypress/e2e/certificate-provider/enter-reference-number.cy.js":{"time":3879,"weight":7},"cypress/e2e/certificate-provider/language-preferences.cy.js":{"time":1161,"weight":2},"cypress/e2e/certificate-provider/provide-certificate.cy.js":{"time":2136,"weight":3},"cypress/e2e/certificate-provider/read-the-lpa.cy.js":{"time":1511,"weight":2},"cypress/e2e/certificate-provider/start.cy.js":{"time":295,"weight":0},"cypress/e2e/certificate-provider/task-list.cy.js":{"time":452,"weight":0},"cypress/e2e/certificate-provider/what-is-your-home-address.cy.js":{"time":10634,"weight":19},"cypress/e2e/certificate-provider/who-is-eligible.cy.js":{"time":563,"weight":1},"cypress/e2e/dev-features.cy.js":{"time":362,"weight":0},"cypress/e2e/donor/add-correspondent.cy.js":{"time":8121,"weight":14},"cypress/e2e/donor/can-you-sign-your-lpa.cy.js":{"time":916,"weight":1},"cypress/e2e/donor/certificate-provider.cy.js":{"time":17522,"weight":31},"cypress/e2e/donor/check-you-can-sign.cy.js":{"time":1020,"weight":1},"cypress/e2e/donor/check-your-details.cy.js":{"time":1386,"weight":2},"cypress/e2e/donor/check-your-lpa.cy.js":{"time":9361,"weight":16},"cypress/e2e/donor/choose-attorneys-address.cy.js":{"time":10275,"weight":18},"cypress/e2e/donor/choose-attorneys-summary.cy.js":{"time":7591,"weight":13},"cypress/e2e/donor/choose-attorneys-task.cy.js":{"time":20301,"weight":36},"cypress/e2e/donor/choose-attorneys.cy.js":{"time":11407,"weight":20},"cypress/e2e/donor/choose-people-to-notify-address.cy.js":{"time":4029,"weight":7},"cypress/e2e/donor/choose-replacement-attorneys-address.cy.js":{"time":7568,"weight":13},"cypress/e2e/donor/choose-replacement-attorneys-summary.cy.js":{"time":7228,"weight":13},"cypress/e2e/donor/choose-replacement-attorneys-task.cy.js":{"time":120591,"weight":218},"cypress/e2e/donor/choose-replacement-attorneys.cy.js":{"time":12531,"weight":22},"cypress/e2e/donor/choose-someone-to-vouch-for-you.cy.js":{"time":717,"weight":1},"cypress/e2e/donor/confirm-person-allowed-to-vouch.cy.js":{"time":4421,"weight":7},"cypress/e2e/donor/confirm-your-certificate-provider-is-not-related.cy.js":{"time":2027,"weight":3},"cypress/e2e/donor/confirm-your-identity.cy.js":{"time":11599,"weight":20},"cypress/e2e/donor/cost-of-repeat-application.cy.js":{"time":969,"weight":1},"cypress/e2e/donor/dashboard.cy.js":{"time":3479,"weight":6},"cypress/e2e/donor/delete-lpa.cy.js":{"time":1152,"weight":2},"cypress/e2e/donor/enter-access-code.cy.js":{"time":1116,"weight":2},"cypress/e2e/donor/enter-replacement-trust-corporation-address.cy.js":{"time":10638,"weight":19},"cypress/e2e/donor/enter-replacement-trust-corporation.cy.js":{"time":2391,"weight":4},"cypress/e2e/donor/enter-trust-corporation-address.cy.js":{"time":10880,"weight":19},"cypress/e2e/donor/enter-trust-corporation.cy.js":{"time":2383,"weight":4},"cypress/e2e/donor/enter-voucher.cy.js":{"time":2085,"weight":3},"cypress/e2e/donor/how-should-attorneys-make-decisions.cy.js":{"time":3185,"weight":5},"cypress/e2e/donor/how-should-replacement-attorneys-make-decisions.cy.js":{"time":2358,"weight":4},"cypress/e2e/donor/how-should-replacement-attorneys-step-in.cy.js":{"time":2089,"weight":3},"cypress/e2e/donor/language-preferences.cy.js":{"time":1270,"weight":2},"cypress/e2e/donor/life-sustaining-treatment.cy.js":{"time":1399,"weight":2},"cypress/e2e/donor/lpa-type.cy.js":{"time":6386,"weight":11},"cypress/e2e/donor/make-a-new-lpa.cy.js":{"time":4584,"weight":8},"cypress/e2e/donor/payment.cy.js":{"time":28775,"weight":52},"cypress/e2e/donor/people-to-notify.cy.js":{"time":10771,"weight":19},"cypress/e2e/donor/previous-application-number.cy.js":{"time":1312,"weight":2},"cypress/e2e/donor/progress.cy.js":{"time":3162,"weight":5},"cypress/e2e/donor/provide-your-details.cy.js":{"time":4999,"weight":9},"cypress/e2e/donor/remove-replacement-trust-corporation.cy.js":{"time":920,"weight":1},"cypress/e2e/donor/remove-trust-corporation.cy.js":{"time":846,"weight":1},"cypress/e2e/donor/restrictions.cy.js":{"time":837,"weight":1},"cypress/e2e/donor/sign-the-lpa.cy.js":{"time":8701,"weight":15},"cypress/e2e/donor/signing-on-behalf.cy.js":{"time":3069,"weight":5},"cypress/e2e/donor/start.cy.js":{"time":740,"weight":1},"cypress/e2e/donor/task-list.cy.js":{"time":429,"weight":0},"cypress/e2e/donor/view-lpa.cy.js":{"time":1465,"weight":2},"cypress/e2e/donor/want-replacement-attorneys.cy.js":{"time":2326,"weight":4},"cypress/e2e/donor/what-you-can-do-now.cy.js":{"time":17541,"weight":31},"cypress/e2e/donor/when-can-the-lpa-be-used.cy.js":{"time":895,"weight":1},"cypress/e2e/donor/withdraw-lpa.cy.js":{"time":1289,"weight":2},"cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js":{"time":18,"weight":0},"cypress/e2e/donor/your-address.cy.js":{"time":8000,"weight":14},"cypress/e2e/donor/your-authorised-signatory.cy.js":{"time":2090,"weight":3},"cypress/e2e/donor/your-date-of-birth.cy.js":{"time":4916,"weight":8},"cypress/e2e/donor/your-independent-witness-address.cy.js":{"time":9977,"weight":18},"cypress/e2e/donor/your-independent-witness-mobile.cy.js":{"time":2271,"weight":4},"cypress/e2e/donor/your-independent-witness.cy.js":{"time":2502,"weight":4},"cypress/e2e/donor/your-name.cy.js":{"time":2708,"weight":4},"cypress/e2e/error-pages.cy.js":{"time":1483,"weight":2},"cypress/e2e/navigation.cy.js":{"time":547,"weight":0},"cypress/e2e/supporter/add-correspondent.cy.js":{"time":11371,"weight":20},"cypress/e2e/supporter/dashboard.cy.js":{"time":8644,"weight":15},"cypress/e2e/supporter/donor-access.cy.js":{"time":4748,"weight":8},"cypress/e2e/supporter/edit-member.cy.js":{"time":8195,"weight":14},"cypress/e2e/supporter/enter-organisation-name.cy.js":{"time":1632,"weight":2},"cypress/e2e/supporter/invite-member.cy.js":{"time":4600,"weight":8},"cypress/e2e/supporter/manage-organisation.cy.js":{"time":4405,"weight":7},"cypress/e2e/supporter/manage-team-members.cy.js":{"time":2786,"weight":5},"cypress/e2e/supporter/start.cy.js":{"time":1307,"weight":2},"cypress/e2e/supporter/suspended.cy.js":{"time":391,"weight":0},"cypress/e2e/supporter/view-lpa.cy.js":{"time":7191,"weight":13},"cypress/e2e/voucher/confirm-your-identity.cy.js":{"time":6196,"weight":11},"cypress/e2e/voucher/confirm-your-name.cy.js":{"time":4304,"weight":7},"cypress/e2e/voucher/enter-reference-number.cy.js":{"time":3683,"weight":6},"cypress/e2e/voucher/verify-donor-details.cy.js":{"time":803,"weight":1},"cypress/e2e/voucher/your-declaration.cy.js":{"time":833,"weight":1}} diff --git a/internal/donor/donordata/provided.go b/internal/donor/donordata/provided.go index 329aedf455..bed24cf9e8 100644 --- a/internal/donor/donordata/provided.go +++ b/internal/donor/donordata/provided.go @@ -175,9 +175,14 @@ type Provided struct { HasSentApplicationUpdatedEvent bool `hash:"-"` } -// CanChange returns true if the donor can make changes to their LPA. -func (p *Provided) CanChange() bool { - return p.SignedAt.IsZero() +// CanChangePersonalDetails returns true if the donor can make changes to their FirstNames, LastName or DateOfBirth. +func (p *Provided) CanChangePersonalDetails() bool { + if p.IdentityUserData.Status.IsConfirmed() || !p.SignedAt.IsZero() { + return false + } + + // is a vouch attempt in progress + return !p.IdentityUserData.Status.IsInsufficientEvidence() || p.Voucher.FirstNames == "" } func (p *Provided) HashInclude(field string, _ any) (bool, error) { diff --git a/internal/donor/donordata/provided_test.go b/internal/donor/donordata/provided_test.go index 68cad5f64d..1ed4f1764e 100644 --- a/internal/donor/donordata/provided_test.go +++ b/internal/donor/donordata/provided_test.go @@ -23,9 +23,45 @@ var address = place.Address{ Postcode: "e", } -func TestProvidedCanChange(t *testing.T) { - assert.True(t, (&Provided{}).CanChange()) - assert.False(t, (&Provided{SignedAt: time.Now()}).CanChange()) +func TestProvidedCanChangePersonalDetails(t *testing.T) { + testcases := map[string]struct { + provided Provided + canChange bool + }{ + "no details": { + provided: Provided{}, + canChange: true, + }, + "signed": { + provided: Provided{ + SignedAt: time.Now(), + }, + }, + "vouch in progress": { + provided: Provided{ + Voucher: Voucher{FirstNames: "a"}, + IdentityUserData: identity.UserData{Status: identity.StatusInsufficientEvidence}, + }, + }, + "vouch not in progress (missing name)": { + provided: Provided{ + IdentityUserData: identity.UserData{Status: identity.StatusInsufficientEvidence}, + }, + canChange: true, + }, + "vouch not in progress (missing status)": { + provided: Provided{ + Voucher: Voucher{FirstNames: "a"}, + }, + canChange: true, + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + assert.Equal(t, tc.canChange, tc.provided.CanChangePersonalDetails()) + }) + } } func TestGenerateHash(t *testing.T) { diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index d8bc172d88..0db6c1a60a 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -3,9 +3,6 @@ {{ define "pageTitle" }}{{ tr .App "yourDetails" }}{{ end }} {{ define "main" }} - {{ $vouchInProgress := and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }} - {{ $canChange := and .Donor.SignedAt.IsZero (not (or .Donor.IdentityUserData.Status.IsConfirmed $vouchInProgress)) }} -
@@ -15,17 +12,17 @@ {{ template "summary-row" (summaryRow .App "firstNames" .Donor.Donor.FirstNames (fromLink .App global.Paths.YourName "#f-first-names") - .Donor.Donor.FullName $canChange true) }} + .Donor.Donor.FullName .Donor.CanChangePersonalDetails true) }} {{ template "summary-row" (summaryRow .App "lastName" .Donor.Donor.LastName (fromLink .App global.Paths.YourName "#f-last-name") - .Donor.Donor.FullName $canChange true) }} + .Donor.Donor.FullName .Donor.CanChangePersonalDetails true) }} {{ template "summary-row" (summaryRow .App "dateOfBirth" (formatDate .App .Donor.Donor.DateOfBirth) (fromLink .App global.Paths.YourDateOfBirth "#f-date-of-birth") - .Donor.Donor.FullName $canChange true) }} + .Donor.Donor.FullName .Donor.CanChangePersonalDetails true) }} {{ template "address-summary-row" (summaryRow $.App "address" .Donor.Donor.Address @@ -47,7 +44,7 @@

{{ tr .App "someOfTheseDetailsCanNoLongerBeChanged" }}

{{ end }} - {{ if $vouchInProgress }} + {{ if and .Donor.IdentityUserData.Status.IsInsufficientEvidence .Donor.Voucher.FirstNames }}

{{ tr .App "Placeholder text to show details cannot be updated while a voucher is confirming the donor’s identity" }}

{{ end }} diff --git a/web/template/layout/changeable-contextual-lpa.gohtml b/web/template/layout/changeable-contextual-lpa.gohtml index 2082bbad7b..67692c99bd 100644 --- a/web/template/layout/changeable-contextual-lpa.gohtml +++ b/web/template/layout/changeable-contextual-lpa.gohtml @@ -3,7 +3,7 @@ {{ $isPropertyAndAffairs := .Donor.Type.IsPropertyAndAffairs }} {{ $isDonor := .App.IsDonor }} {{ $canChange := and $isDonor .Donor.SignedAt.IsZero }} - {{ $canChangePersonalDetails := and .Donor.IdentityUserData.Status.IsUnknown $canChange }} + {{ $canChangePersonalDetails := and .Donor.CanChangePersonalDetails $canChange }} {{ template "contextual-lpa-warning" . }} From e4a7a1339d1edbb3dbcdade46dce519d8ccf5f23 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Tue, 7 Jan 2025 10:19:10 +0000 Subject: [PATCH 08/10] MLPAB-2692 use VoucherInvitedAt to determine if vouch in progress --- internal/donor/donordata/provided.go | 15 +++--- internal/donor/donordata/provided_test.go | 22 +++----- .../donor/donorpage/check_your_details.go | 9 +++- .../donorpage/check_your_details_test.go | 50 +++++++++++++++++-- internal/donor/donorpage/register.go | 2 +- internal/donor/store.go | 2 + internal/donor/store_test.go | 9 ++-- internal/page/fixtures/donor.go | 1 + web/template/donor/check_your_details.gohtml | 6 +-- 9 files changed, 79 insertions(+), 37 deletions(-) diff --git a/internal/donor/donordata/provided.go b/internal/donor/donordata/provided.go index bed24cf9e8..442ea7c564 100644 --- a/internal/donor/donordata/provided.go +++ b/internal/donor/donordata/provided.go @@ -172,17 +172,17 @@ type Provided struct { // AttorneysInvitedAt records when the invites are sent to the attorneys. AttorneysInvitedAt time.Time + // VoucherInvitedAt records when the invite is sent to the voucher to vouch. + VoucherInvitedAt time.Time + HasSentApplicationUpdatedEvent bool `hash:"-"` } // CanChangePersonalDetails returns true if the donor can make changes to their FirstNames, LastName or DateOfBirth. func (p *Provided) CanChangePersonalDetails() bool { - if p.IdentityUserData.Status.IsConfirmed() || !p.SignedAt.IsZero() { - return false - } - - // is a vouch attempt in progress - return !p.IdentityUserData.Status.IsInsufficientEvidence() || p.Voucher.FirstNames == "" + return !p.IdentityUserData.Status.IsConfirmed() && + p.SignedAt.IsZero() && + p.VoucherInvitedAt.IsZero() } func (p *Provided) HashInclude(field string, _ any) (bool, error) { @@ -232,7 +232,8 @@ func (c toCheck) HashInclude(field string, _ any) (bool, error) { "FailedVouchAttempts", "CostOfRepeatApplication", "CertificateProviderInvitedAt", - "AttorneysInvitedAt": + "AttorneysInvitedAt", + "VoucherInvitedAt": return false, nil } diff --git a/internal/donor/donordata/provided_test.go b/internal/donor/donordata/provided_test.go index 1ed4f1764e..20d7df46c8 100644 --- a/internal/donor/donordata/provided_test.go +++ b/internal/donor/donordata/provided_test.go @@ -28,7 +28,7 @@ func TestProvidedCanChangePersonalDetails(t *testing.T) { provided Provided canChange bool }{ - "no details": { + "no personal details": { provided: Provided{}, canChange: true, }, @@ -37,23 +37,15 @@ func TestProvidedCanChangePersonalDetails(t *testing.T) { SignedAt: time.Now(), }, }, - "vouch in progress": { + "identity confirmed": { provided: Provided{ - Voucher: Voucher{FirstNames: "a"}, - IdentityUserData: identity.UserData{Status: identity.StatusInsufficientEvidence}, + IdentityUserData: identity.UserData{Status: identity.StatusConfirmed}, }, }, - "vouch not in progress (missing name)": { - provided: Provided{ - IdentityUserData: identity.UserData{Status: identity.StatusInsufficientEvidence}, - }, - canChange: true, - }, - "vouch not in progress (missing status)": { + "vouch in progress": { provided: Provided{ - Voucher: Voucher{FirstNames: "a"}, + VoucherInvitedAt: testNow, }, - canChange: true, }, } @@ -78,14 +70,14 @@ func TestGenerateHash(t *testing.T) { } // DO change this value to match the updates - const modified uint64 = 0x7789c0f3bc416e1e + const modified uint64 = 0x88bad809bb9c1575 // DO NOT change these initial hash values. If a field has been added/removed // you will need to handle the version gracefully by modifying // (*Provided).HashInclude and adding another testcase for the new // version. testcases := map[uint8]uint64{ - 0: 0xe907158cc0223aec, + 0: 0xb23345a21655d556, } for version, initial := range testcases { diff --git a/internal/donor/donorpage/check_your_details.go b/internal/donor/donorpage/check_your_details.go index c0aa09df6b..c23f661906 100644 --- a/internal/donor/donorpage/check_your_details.go +++ b/internal/donor/donorpage/check_your_details.go @@ -2,6 +2,7 @@ package donorpage import ( "net/http" + "time" "github.com/ministryofjustice/opg-go-common/template" "github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" @@ -16,13 +17,19 @@ type checkYourDetailsData struct { Donor *donordata.Provided } -func CheckYourDetails(tmpl template.Template, shareCodeSender ShareCodeSender) Handler { +func CheckYourDetails(tmpl template.Template, shareCodeSender ShareCodeSender, now func() time.Time, donorStore DonorStore) Handler { return func(appData appcontext.Data, w http.ResponseWriter, r *http.Request, provided *donordata.Provided) error { if r.Method == http.MethodPost { if provided.Tasks.PayForLpa.IsCompleted() { if err := shareCodeSender.SendVoucherAccessCode(r.Context(), provided, appData); err != nil { return err } + + provided.VoucherInvitedAt = now() + + if err := donorStore.Put(r.Context(), provided); err != nil { + return err + } } return donor.PathWeHaveContactedVoucher.Redirect(w, r, appData, provided) diff --git a/internal/donor/donorpage/check_your_details_test.go b/internal/donor/donorpage/check_your_details_test.go index 7d227bf2ac..97a185dce1 100644 --- a/internal/donor/donorpage/check_your_details_test.go +++ b/internal/donor/donorpage/check_your_details_test.go @@ -9,6 +9,7 @@ import ( "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" "github.com/ministryofjustice/opg-modernising-lpa/internal/task" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) func TestGetCheckYourDetails(t *testing.T) { @@ -22,7 +23,7 @@ func TestGetCheckYourDetails(t *testing.T) { Execute(w, &checkYourDetailsData{App: testAppData, Donor: donor}). Return(nil) - err := CheckYourDetails(template.Execute, nil)(testAppData, w, r, donor) + err := CheckYourDetails(template.Execute, nil, nil, nil)(testAppData, w, r, donor) resp := w.Result() assert.Nil(t, err) @@ -38,7 +39,7 @@ func TestGetCheckYourDetailsWhenTemplateErrors(t *testing.T) { Execute(w, &checkYourDetailsData{App: testAppData, Donor: &donordata.Provided{}}). Return(expectedError) - err := CheckYourDetails(template.Execute, nil)(testAppData, w, r, &donordata.Provided{}) + err := CheckYourDetails(template.Execute, nil, nil, nil)(testAppData, w, r, &donordata.Provided{}) assert.Equal(t, expectedError, err) } @@ -59,7 +60,18 @@ func TestPostCheckYourDetails(t *testing.T) { SendVoucherAccessCode(r.Context(), provided, testAppData). Return(nil) - err := CheckYourDetails(nil, shareCodeSender)(testAppData, w, r, provided) + donorStore := newMockDonorStore(t) + donorStore.EXPECT(). + Put(r.Context(), &donordata.Provided{ + LpaID: "lpa-id", + Tasks: donordata.Tasks{ + PayForLpa: task.PaymentStateCompleted, + }, + VoucherInvitedAt: testNow, + }). + Return(nil) + + err := CheckYourDetails(nil, shareCodeSender, testNowFn, donorStore)(testAppData, w, r, provided) resp := w.Result() assert.Nil(t, err) @@ -71,7 +83,7 @@ func TestPostCheckYourDetailsWhenUnpaid(t *testing.T) { w := httptest.NewRecorder() r, _ := http.NewRequest(http.MethodPost, "/", nil) - err := CheckYourDetails(nil, nil)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"}) + err := CheckYourDetails(nil, nil, nil, nil)(testAppData, w, r, &donordata.Provided{LpaID: "lpa-id"}) resp := w.Result() assert.Nil(t, err) @@ -95,7 +107,35 @@ func TestPostCheckYourDetailsWhenShareCodeStoreError(t *testing.T) { SendVoucherAccessCode(r.Context(), provided, testAppData). Return(expectedError) - err := CheckYourDetails(nil, shareCodeSender)(testAppData, w, r, provided) + err := CheckYourDetails(nil, shareCodeSender, nil, nil)(testAppData, w, r, provided) + resp := w.Result() + + assert.Error(t, err) + assert.Equal(t, http.StatusOK, resp.StatusCode) +} + +func TestPostCheckYourDetailsWhenDonorStoreError(t *testing.T) { + w := httptest.NewRecorder() + r, _ := http.NewRequest(http.MethodPost, "/", nil) + + provided := &donordata.Provided{ + LpaID: "lpa-id", + Tasks: donordata.Tasks{ + PayForLpa: task.PaymentStateCompleted, + }, + } + + shareCodeSender := newMockShareCodeSender(t) + shareCodeSender.EXPECT(). + SendVoucherAccessCode(mock.Anything, mock.Anything, mock.Anything). + Return(nil) + + donorStore := newMockDonorStore(t) + donorStore.EXPECT(). + Put(mock.Anything, mock.Anything). + Return(expectedError) + + err := CheckYourDetails(nil, shareCodeSender, testNowFn, donorStore)(testAppData, w, r, provided) resp := w.Result() assert.Error(t, err) diff --git a/internal/donor/donorpage/register.go b/internal/donor/donorpage/register.go index 69150fbc99..4e3ada409f 100644 --- a/internal/donor/donorpage/register.go +++ b/internal/donor/donorpage/register.go @@ -417,7 +417,7 @@ func Register( handleWithDonor(donor.PathConfirmPersonAllowedToVouch, page.CanGoBack, ConfirmPersonAllowedToVouch(tmpls.Get("confirm_person_allowed_to_vouch.gohtml"), donorStore)) handleWithDonor(donor.PathCheckYourDetails, page.CanGoBack, - CheckYourDetails(tmpls.Get("check_your_details.gohtml"), shareCodeSender)) + CheckYourDetails(tmpls.Get("check_your_details.gohtml"), shareCodeSender, time.Now, donorStore)) handleWithDonor(donor.PathWeHaveContactedVoucher, page.None, Guidance(tmpls.Get("we_have_contacted_voucher.gohtml"))) handleWithDonor(donor.PathWhatYouCanDoNow, page.CanGoBack, diff --git a/internal/donor/store.go b/internal/donor/store.go index c86e4a62cb..717e7ce5f7 100644 --- a/internal/donor/store.go +++ b/internal/donor/store.go @@ -488,6 +488,7 @@ func (s *Store) DeleteVoucher(ctx context.Context, provided *donordata.Provided) } provided.Voucher = donordata.Voucher{} + provided.VoucherInvitedAt = time.Time{} transaction := dynamo.NewTransaction(). Delete(dynamo.Keys{PK: link.PK, SK: link.SK}). @@ -500,6 +501,7 @@ func (s *Store) FailVoucher(ctx context.Context, provided *donordata.Provided, v provided.FailedVouchAttempts++ provided.WantVoucher = form.No provided.Voucher = donordata.Voucher{} + provided.VoucherInvitedAt = time.Time{} transaction := dynamo.NewTransaction(). Delete(dynamo.Keys{PK: provided.PK, SK: voucherKey}). diff --git a/internal/donor/store_test.go b/internal/donor/store_test.go index 7509e57a19..205c36b34b 100644 --- a/internal/donor/store_test.go +++ b/internal/donor/store_test.go @@ -1075,7 +1075,7 @@ func TestDonorStoreDeleteVoucher(t *testing.T) { donorStore := &Store{dynamoClient: dynamoClient} err := donorStore.DeleteVoucher(ctx, &donordata.Provided{ - Voucher: donordata.Voucher{FirstNames: "a"}, + Voucher: donordata.Voucher{FirstNames: "a"}, VoucherInvitedAt: testNow, }) assert.Equal(t, expectedError, err) } @@ -1126,9 +1126,10 @@ func TestDonorFailVoucher(t *testing.T) { donorStore := &Store{dynamoClient: dynamoClient} err := donorStore.FailVoucher(ctx, &donordata.Provided{ - PK: dynamo.LpaKey("lpa-id"), - Voucher: donordata.Voucher{FirstNames: "a"}, - WantVoucher: form.Yes, + PK: dynamo.LpaKey("lpa-id"), + Voucher: donordata.Voucher{FirstNames: "a"}, + WantVoucher: form.Yes, + VoucherInvitedAt: testNow, }, dynamo.VoucherKey("a-voucher")) assert.Equal(t, expectedError, err) } diff --git a/internal/page/fixtures/donor.go b/internal/page/fixtures/donor.go index 2b81a827bd..6be58d26a6 100644 --- a/internal/page/fixtures/donor.go +++ b/internal/page/fixtures/donor.go @@ -459,6 +459,7 @@ func updateLPAProgress( if data.Voucher == "1" { donorDetails.Voucher = makeVoucher(voucherName) donorDetails.WantVoucher = form.Yes + donorDetails.VoucherInvitedAt = time.Now() } attempts, err := strconv.Atoi(data.FailedVouchAttempts) diff --git a/web/template/donor/check_your_details.gohtml b/web/template/donor/check_your_details.gohtml index a274a5114c..99546bacb8 100644 --- a/web/template/donor/check_your_details.gohtml +++ b/web/template/donor/check_your_details.gohtml @@ -3,8 +3,6 @@ {{ define "pageTitle" }}{{ tr .App "checkYourDetails" }}{{ end }} {{ define "main" }} - {{ $hasNoIdentity := and .Donor.IdentityUserData.Status.IsUnknown .Donor.SignedAt.IsZero }} -

{{ tr .App "checkYourDetails" }}

@@ -14,12 +12,12 @@ {{ template "summary-row" (summaryRow .App "name" .Donor.Donor.FullName (fromLink .App global.Paths.YourDetails "#f-first-names") - "" $hasNoIdentity true + "" .Donor.CanChangePersonalDetails true ) }} {{ template "summary-row" (summaryRow .App "dateOfBirth" (formatDate .App .Donor.Donor.DateOfBirth) (fromLink .App global.Paths.YourDateOfBirth "#f-date-of-birth") - "" $hasNoIdentity true + "" .Donor.CanChangePersonalDetails true ) }} {{ template "address-summary-row" (summaryRow .App "address" .Donor.Donor.Address From d29693f757638caad2e8835b729b5541de4518fb Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Tue, 7 Jan 2025 10:30:25 +0000 Subject: [PATCH 09/10] MLPAB-2692 reinstate CanChange --- internal/donor/donordata/provided.go | 5 +++++ internal/donor/donordata/provided_test.go | 5 +++++ internal/donor/donorpage/identity_details.go | 2 +- internal/donor/store.go | 2 +- web/template/donor/check_your_details.gohtml | 2 +- web/template/donor/check_your_lpa.gohtml | 4 ++-- web/template/donor/choose_attorneys_summary.gohtml | 2 +- web/template/donor/choose_people_to_notify_summary.gohtml | 2 +- .../donor/choose_replacement_attorneys_summary.gohtml | 2 +- web/template/donor/identity_details.gohtml | 6 +++--- web/template/donor/your_details.gohtml | 6 +++--- web/template/layout/changeable-contextual-lpa.gohtml | 2 +- 12 files changed, 25 insertions(+), 15 deletions(-) diff --git a/internal/donor/donordata/provided.go b/internal/donor/donordata/provided.go index 442ea7c564..66c8f637df 100644 --- a/internal/donor/donordata/provided.go +++ b/internal/donor/donordata/provided.go @@ -178,6 +178,11 @@ type Provided struct { HasSentApplicationUpdatedEvent bool `hash:"-"` } +// CanChange returns true if the donor can make changes to their LPA. +func (p *Provided) CanChange() bool { + return p.SignedAt.IsZero() +} + // CanChangePersonalDetails returns true if the donor can make changes to their FirstNames, LastName or DateOfBirth. func (p *Provided) CanChangePersonalDetails() bool { return !p.IdentityUserData.Status.IsConfirmed() && diff --git a/internal/donor/donordata/provided_test.go b/internal/donor/donordata/provided_test.go index 20d7df46c8..3edde90670 100644 --- a/internal/donor/donordata/provided_test.go +++ b/internal/donor/donordata/provided_test.go @@ -23,6 +23,11 @@ var address = place.Address{ Postcode: "e", } +func TestProvidedCanChange(t *testing.T) { + assert.True(t, (&Provided{}).CanChange()) + assert.False(t, (&Provided{SignedAt: time.Now()}).CanChange()) +} + func TestProvidedCanChangePersonalDetails(t *testing.T) { testcases := map[string]struct { provided Provided diff --git a/internal/donor/donorpage/identity_details.go b/internal/donor/donorpage/identity_details.go index 094ec95034..15d641885f 100644 --- a/internal/donor/donorpage/identity_details.go +++ b/internal/donor/donorpage/identity_details.go @@ -43,7 +43,7 @@ func IdentityDetails(tmpl template.Template, donorStore DonorStore) Handler { AddressMatch: provided.Donor.Address.Postcode == provided.IdentityUserData.CurrentAddress.Postcode, } - if r.Method == http.MethodPost && provided.SignedAt.IsZero() { + if r.Method == http.MethodPost && provided.CanChange() { f := form.ReadYesNoForm(r, "yesIfWouldLikeToUpdateDetails") data.Errors = f.Validate() diff --git a/internal/donor/store.go b/internal/donor/store.go index 717e7ce5f7..d4eddf78b5 100644 --- a/internal/donor/store.go +++ b/internal/donor/store.go @@ -341,7 +341,7 @@ func (s *Store) Put(ctx context.Context, donor *donordata.Provided) error { } appData := appcontext.DataFromContext(ctx) - if appData.IsDonor() && !donor.SignedAt.IsZero() && donor.CheckedHashChanged() { + if appData.IsDonor() && !donor.CanChange() && donor.CheckedHashChanged() { return errors.New("donor tried to change a signed LPA") } diff --git a/web/template/donor/check_your_details.gohtml b/web/template/donor/check_your_details.gohtml index 99546bacb8..384a2b9553 100644 --- a/web/template/donor/check_your_details.gohtml +++ b/web/template/donor/check_your_details.gohtml @@ -22,7 +22,7 @@ {{ template "address-summary-row" (summaryRow .App "address" .Donor.Donor.Address (fromLink .App global.Paths.YourAddress "#f-address-line-1") - "" .Donor.SignedAt.IsZero true + "" .Donor.CanChange true ) }} diff --git a/web/template/donor/check_your_lpa.gohtml b/web/template/donor/check_your_lpa.gohtml index ec38f342f8..4b945269d8 100644 --- a/web/template/donor/check_your_lpa.gohtml +++ b/web/template/donor/check_your_lpa.gohtml @@ -15,13 +15,13 @@ {{ tr .App "lpaDecisions" }} - {{ template "lpa-decisions" (lpaDecisions .App .Donor .Donor.SignedAt.IsZero) }} + {{ template "lpa-decisions" (lpaDecisions .App .Donor .Donor.CanChange) }}

{{ tr .App "peopleNamedOnTheLpa" }}

- {{ template "people-named-on-lpa" (lpaDecisions .App .Donor .Donor.SignedAt.IsZero) }} + {{ template "people-named-on-lpa" (lpaDecisions .App .Donor .Donor.CanChange) }} {{ if .CanContinue }} diff --git a/web/template/donor/choose_attorneys_summary.gohtml b/web/template/donor/choose_attorneys_summary.gohtml index a14c71660f..7249cdd012 100644 --- a/web/template/donor/choose_attorneys_summary.gohtml +++ b/web/template/donor/choose_attorneys_summary.gohtml @@ -7,7 +7,7 @@

{{ trCount .App "attorneysAdded" .Donor.Attorneys.Len }}

- {{ template "attorney-summary" (listAttorneys .App .Donor.Attorneys "attorney" 2 .Donor.SignedAt.IsZero) }} + {{ template "attorney-summary" (listAttorneys .App .Donor.Attorneys "attorney" 2 .Donor.CanChange) }} {{ template "radios-fieldset" (fieldset . .Form.FieldName "" diff --git a/web/template/donor/choose_people_to_notify_summary.gohtml b/web/template/donor/choose_people_to_notify_summary.gohtml index 63bc87e514..711c8f836f 100644 --- a/web/template/donor/choose_people_to_notify_summary.gohtml +++ b/web/template/donor/choose_people_to_notify_summary.gohtml @@ -9,7 +9,7 @@ {{ trHtml .App "weCanNotifyUpTo5PeopleContent" }} - {{ template "people-to-notify-summary" (listPeopleToNotify .App .Donor.PeopleToNotify 2 .Donor.SignedAt.IsZero) }} + {{ template "people-to-notify-summary" (listPeopleToNotify .App .Donor.PeopleToNotify 2 .Donor.CanChange) }} {{ if eq 5 (len .Donor.PeopleToNotify) }} {{ template "information-banner" (content .App "addedMaxPeople") }} diff --git a/web/template/donor/choose_replacement_attorneys_summary.gohtml b/web/template/donor/choose_replacement_attorneys_summary.gohtml index 061d81cde8..16518fa03f 100644 --- a/web/template/donor/choose_replacement_attorneys_summary.gohtml +++ b/web/template/donor/choose_replacement_attorneys_summary.gohtml @@ -7,7 +7,7 @@

{{ trCount .App "replacementAttorneysAdded" .Donor.ReplacementAttorneys.Len }}

- {{ template "attorney-summary" (listAttorneys .App .Donor.ReplacementAttorneys "replacement" 2 .Donor.SignedAt.IsZero) }} + {{ template "attorney-summary" (listAttorneys .App .Donor.ReplacementAttorneys "replacement" 2 .Donor.CanChange) }} {{ template "radios-fieldset" (fieldset . .Form.FieldName "" diff --git a/web/template/donor/identity_details.gohtml b/web/template/donor/identity_details.gohtml index 5b76ed68c9..e77568519b 100644 --- a/web/template/donor/identity_details.gohtml +++ b/web/template/donor/identity_details.gohtml @@ -14,7 +14,7 @@ {{ if not .Provided.WantVoucher.IsYes }} {{ template "notification-banner" (notificationBanner .App "success" (trHtml .App "youHaveSuccessfullyConfirmedYourIdentitySuccess:donor") "success" "contents" ) }} {{ end }} - {{ else if .Provided.SignedAt.IsZero }} + {{ else if .Provided.CanChange }} {{ template "warning-banner" (content .App "someDetailsDoNotMatchIdentityDetailsWarning") }} {{ else }} {{ template "notification-banner" (notificationBanner .App "important" (trHtml .App "theDetailsOnYourLpaDoNotMatch") "heading") }} @@ -69,7 +69,7 @@ {{ template "identity-details" (card .App .Provided.IdentityUserData) }} - {{ if not .Provided.SignedAt.IsZero }} + {{ if not .Provided.CanChange }}

{{ tr .App "whatHappensNext" }}

{{ trHtml .App "theDetailsOnYourLpaCannotBeUpdatedAsSigned" }} @@ -77,7 +77,7 @@ {{ template "warning" (content .App "ifYouDoNotWantRegisteredWithConfirmedDetailsWarning") }} {{ end }} - {{ if or .DetailsMatch (not .Provided.SignedAt.IsZero) }} + {{ if or .DetailsMatch (not .Provided.CanChange) }} {{ template "button" (button .App "returnToTaskList" "link" (global.Paths.TaskList.Format .Provided.LpaID)) }} {{ else }} diff --git a/web/template/donor/your_details.gohtml b/web/template/donor/your_details.gohtml index 0db6c1a60a..8c3a21d598 100644 --- a/web/template/donor/your_details.gohtml +++ b/web/template/donor/your_details.gohtml @@ -27,17 +27,17 @@ {{ template "address-summary-row" (summaryRow $.App "address" .Donor.Donor.Address (fromLink .App global.Paths.YourAddress "#f-address-line-1") - .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} + .Donor.Donor.FullName .Donor.CanChange true) }} {{ template "summary-row" (summaryRow .App "email" .Donor.Donor.Email (fromLink .App global.Paths.YourEmail "#f-email") - .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} + .Donor.Donor.FullName .Donor.CanChange true) }} {{ template "summary-row" (summaryRow .App "mobile" .Donor.Donor.Mobile (fromLink .App global.Paths.YourMobile "#f-mobile") - .Donor.Donor.FullName .Donor.SignedAt.IsZero true) }} + .Donor.Donor.FullName .Donor.CanChange true) }} {{ if .Donor.IdentityUserData.Status.IsConfirmed }} diff --git a/web/template/layout/changeable-contextual-lpa.gohtml b/web/template/layout/changeable-contextual-lpa.gohtml index 67692c99bd..41bf5965dc 100644 --- a/web/template/layout/changeable-contextual-lpa.gohtml +++ b/web/template/layout/changeable-contextual-lpa.gohtml @@ -2,7 +2,7 @@ {{ $donorFullName := .Donor.Donor.FullName }} {{ $isPropertyAndAffairs := .Donor.Type.IsPropertyAndAffairs }} {{ $isDonor := .App.IsDonor }} - {{ $canChange := and $isDonor .Donor.SignedAt.IsZero }} + {{ $canChange := and $isDonor .Donor.CanChange }} {{ $canChangePersonalDetails := and .Donor.CanChangePersonalDetails $canChange }} {{ template "contextual-lpa-warning" . }} From cf7dda2ea41433cbb66c170f4ae86a3e0bf62059 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Tue, 7 Jan 2025 13:01:41 +0000 Subject: [PATCH 10/10] MLPAB-2692 allow going to name and dob --- cypress/e2e/donor/check-your-details.cy.js | 17 +++++++++++++---- internal/donor/path.go | 2 +- internal/donor/path_test.go | 4 ++-- web/template/donor/check_your_details.gohtml | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/donor/check-your-details.cy.js b/cypress/e2e/donor/check-your-details.cy.js index f4b9a632b3..49c8a908b4 100644 --- a/cypress/e2e/donor/check-your-details.cy.js +++ b/cypress/e2e/donor/check-your-details.cy.js @@ -1,11 +1,20 @@ describe('Check your details', () => { it('shows my details', () => { - cy.visit('/fixtures?redirect=/check-your-details&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&voucher=1'); + cy.visit('/fixtures?redirect=/check-your-details&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence'); cy.checkA11yApp(); - cy.contains('Sam Smith'); - cy.contains('2 January 2000'); - cy.contains('1 RICHMOND PLACE'); + cy.contains('Sam Smith').parent().contains('a', 'Change').click() + cy.url().should('contain', '/your-name'); + cy.contains('button', 'Save and continue').click(); + + cy.contains('2 January 2000').parent().contains('a', 'Change').click() + cy.url().should('contain', '/your-date-of-birth'); + cy.contains('button', 'Save and continue').click(); + + cy.contains('1 RICHMOND PLACE').parent().contains('a', 'Change').click() + cy.url().should('contain', '/your-address'); + cy.contains('button', 'Save and continue').click(); + cy.contains('button', 'Continue').click(); cy.url().should('contain', '/we-have-contacted-voucher'); diff --git a/internal/donor/path.go b/internal/donor/path.go index ddb400d099..9b2b47d3e8 100644 --- a/internal/donor/path.go +++ b/internal/donor/path.go @@ -225,7 +225,7 @@ func (p Path) canVisit(donor *donordata.Provided) bool { return section1Completed && (donor.Tasks.PayForLpa.IsCompleted() || donor.Tasks.PayForLpa.IsPending()) case PathYourName, PathYourDateOfBirth: - return donor.IdentityUserData.Status.IsUnknown() + return donor.CanChangePersonalDetails() default: return true diff --git a/internal/donor/path_test.go b/internal/donor/path_test.go index edc01f4fd6..041f1d0837 100644 --- a/internal/donor/path_test.go +++ b/internal/donor/path_test.go @@ -219,12 +219,12 @@ func TestDonorCanGoTo(t *testing.T) { url: PathReadYourLpa.Format("123"), expected: true, }, - "your name when identity not set": { + "your name when can change personal details": { donor: &donordata.Provided{}, url: PathYourName.Format("123"), expected: true, }, - "your name when identity set": { + "your name when cannot change personal details": { donor: &donordata.Provided{ IdentityUserData: identity.UserData{Status: identity.StatusConfirmed}, }, diff --git a/web/template/donor/check_your_details.gohtml b/web/template/donor/check_your_details.gohtml index 384a2b9553..811fbfe145 100644 --- a/web/template/donor/check_your_details.gohtml +++ b/web/template/donor/check_your_details.gohtml @@ -11,7 +11,7 @@
{{ template "summary-row" (summaryRow .App "name" .Donor.Donor.FullName - (fromLink .App global.Paths.YourDetails "#f-first-names") + (fromLink .App global.Paths.YourName "#f-first-names") "" .Donor.CanChangePersonalDetails true ) }} {{ template "summary-row" (summaryRow .App "dateOfBirth"