Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uml 3394 combined lpa manager #2782

Merged
merged 100 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
708f31d
Move to a feature flagged factory for lpa manager creation
cooperaj Jul 5, 2024
5c80c28
Move to using the lpa service interface in preparation for v2 strategy.
cooperaj Jul 4, 2024
1b9e4ee
Update typing information
cooperaj Jul 9, 2024
a6e3e2c
Add authentication to v2 lpas endpoint
cooperaj Sep 3, 2024
ec2cb6f
Incorrect container usage
cooperaj Sep 3, 2024
fb92e71
Use own JWS builder as one in library is not usable how we need.
cooperaj Sep 3, 2024
ddc2549
Use correct secret field name
cooperaj Sep 4, 2024
099914e
Add datastorelpas to configprovider
cooperaj Sep 4, 2024
97be503
Ensure necessary parameter is added to request signer.
cooperaj Sep 4, 2024
230fc39
Add work in progress combined lpa manager and point v2 handler at it.
cooperaj Sep 4, 2024
df18b2e
Managed to add this back in during conflict resolving.
cooperaj Sep 17, 2024
c475071
Rename LpaManagerInterface method as it was a bit clumsy
cooperaj Sep 20, 2024
40dc984
Seed LpaStore lpa
cooperaj Sep 20, 2024
fda86dc
Use LpaDataFormatter for LpaStore lpas
cooperaj Sep 20, 2024
7293c1b
Work to further combine lpa types
cooperaj Sep 20, 2024
74fb7b1
Create openapi documentation for lpas endpoint.
cooperaj Nov 25, 2024
8a14fdd
To make the api work with the Swagger editor cors headers need settin…
cooperaj Nov 25, 2024
cedb861
Composer run script update
cooperaj Dec 3, 2024
e7bf4d5
Add spaties cloneable so we can manipulate our readonly objects (brin…
cooperaj Dec 6, 2024
9c81c42
Add WhenLpaCanBeUsed field to the openapi doc
cooperaj Dec 11, 2024
9fce63b
Update example openapi lpa
cooperaj Dec 11, 2024
788fb97
Tweaking how frontend templated deal with cast type and other enums
cooperaj Dec 11, 2024
dddb888
Move enum value deciphering to the casters rather than being in the e…
cooperaj Dec 11, 2024
d0e5cc6
Remove all concept of differing LPA types on the frontend.
cooperaj Dec 11, 2024
6cb4739
Define interfaces for the frontend entity functions that we use.
cooperaj Dec 11, 2024
b69c3ce
Clean up class variable usage
cooperaj Dec 11, 2024
6bf1c2e
Stop using address arrays if we have a Person on template output
cooperaj Dec 11, 2024
60bae18
Handler tidy up
cooperaj Dec 12, 2024
88ce2a3
v2 handler urls is nice and all but actually pretty complex to implement
cooperaj Dec 12, 2024
6c9da3d
Docblock updates
cooperaj Dec 12, 2024
fe92de3
Make ViewerCodeService Uid source agnostic
cooperaj Dec 13, 2024
4f6d07e
Not really possible to break the rest of this down.
cooperaj Dec 13, 2024
535d35e
Don't need a pipeline setup for a route that doesn't exist.
cooperaj Dec 13, 2024
d0a4029
First test fixes
cooperaj Dec 13, 2024
d57dd7e
fix test
nickdavis2001 Dec 16, 2024
ed55069
fix test
nickdavis2001 Dec 16, 2024
7f2ba7c
fix test
nickdavis2001 Dec 16, 2024
db81293
Fix RequestSignerFactoryTest.php test
cooperaj Dec 16, 2024
495f4f4
fix test
nickdavis2001 Dec 16, 2024
8de701f
fix tests
nickdavis2001 Dec 16, 2024
31df338
fix test
nickdavis2001 Dec 16, 2024
d802965
Fixes to Casters and entities
cooperaj Dec 16, 2024
e44545a
Fixes to Casters and entities
cooperaj Dec 16, 2024
bc7eeee
Fixup address extraction in caster for Sirius Lpas
cooperaj Dec 16, 2024
47d0f19
Serialisation test for lpa store
cooperaj Dec 16, 2024
d8ee685
fix tests
nickdavis2001 Dec 16, 2024
3272f12
Serialisation test for Sirius lpas
cooperaj Dec 16, 2024
4d382e8
fix tests
nickdavis2001 Dec 16, 2024
17f0d90
Serialisation test for Sirius into combined format
cooperaj Dec 16, 2024
ed0c39e
fix test
nickdavis2001 Dec 16, 2024
ea9cb89
fix tests
nickdavis2001 Dec 16, 2024
da272b8
fix test
nickdavis2001 Dec 16, 2024
420f68e
fix some of test
nickdavis2001 Dec 16, 2024
614528d
Fixup FindActorInLpaTest by making Sirius objects a little more robust
cooperaj Dec 16, 2024
72909f3
Final set of unit test fixes (before we start codecoverage work)
cooperaj Dec 16, 2024
dce1478
Tidy up entity handling around enum casting and life sustaining treat…
cooperaj Dec 16, 2024
e72ad9f
combined manager test
nickdavis2001 Dec 17, 2024
f875d1b
UML-3750 fixed frontend unit tests
allenannom Dec 17, 2024
023a2ed
fix up mocks
nickdavis2001 Dec 18, 2024
bfa5ef0
Start of work on CombinedLpaManagerTest
cooperaj Dec 19, 2024
312b107
fix test broken by merge of main into branch
nickdavis2001 Dec 19, 2024
0121a57
WIP tests
nickdavis2001 Dec 19, 2024
2fc45a1
WIP broken, working on test
nickdavis2001 Dec 19, 2024
76b5220
UML-3394 fix ui
allenannom Dec 19, 2024
9444fe7
UML-3394 updated frontend tests - fixed behat tests with feature fla…
allenannom Dec 19, 2024
958232f
Improvements to CombinedLpaManagerTest coverage
cooperaj Dec 20, 2024
30245b5
UML-3394 updated frontend tests - fixed behat tests
allenannom Dec 27, 2024
5e27172
Add test for user token fetch of Sirius LPA
cooperaj Dec 30, 2024
5f45f37
Final coverage fixes for CombinedLpaManager
cooperaj Jan 6, 2025
ec9b217
Composer updates
cooperaj Jan 6, 2025
9996a23
UML-3394 updated front-end tests and improved codecov
allenannom Jan 9, 2025
2898be6
UML-3394 updated api tests and improved codecov
allenannom Jan 10, 2025
c575951
UML-3394 added ResolveLpaTypeTest.php
allenannom Jan 10, 2025
6ef41db
UML-3619 wip
allenannom Sep 30, 2024
4815110
UML-3619 Convert incoming LPAs to combined format (repository layer)
allenannom Oct 3, 2024
864f781
UML-3394 updated CastToWhenTheLpaCanBeUsedTest.php
allenannom Jan 13, 2025
988d12f
Move to a feature flagged factory for lpa manager creation
cooperaj Jul 5, 2024
ca8bfb5
Move to using the lpa service interface in preparation for v2 strategy.
cooperaj Jul 4, 2024
cf29675
Add authentication to v2 lpas endpoint
cooperaj Sep 3, 2024
b9a105a
Managed to add this back in during conflict resolving.
cooperaj Sep 17, 2024
5a934b7
Clean up class variable usage
cooperaj Dec 11, 2024
344c94d
Not really possible to break the rest of this down.
cooperaj Dec 13, 2024
fcdce84
Don't need a pipeline setup for a route that doesn't exist.
cooperaj Dec 13, 2024
5524f0a
Fixes to Casters and entities
cooperaj Dec 16, 2024
dcc0674
Final set of unit test fixes (before we start codecoverage work)
cooperaj Dec 16, 2024
f57e951
fix test broken by merge in of main
nickdavis2001 Dec 19, 2024
b19b2b1
Use mock logger in place of Monolog instance
cooperaj Dec 19, 2024
63e45ef
UML-3394 updated frontend tests - fixed behat tests with feature fla…
allenannom Dec 19, 2024
aaaf483
Fix up some merge issues.
cooperaj Jan 15, 2025
b85c214
Fix FindActorInLpa tests
cooperaj Jan 16, 2025
02a11fc
Tidy up route.php imports
cooperaj Jan 16, 2025
90170c3
SiriusUid field not existent should be handled.
cooperaj Jan 16, 2025
78e8306
UML-3394 fixed lint
allenannom Jan 17, 2025
259a016
UML-3394 fixed broken test & PersonDataFormatterTest.php
allenannom Jan 17, 2025
65f6041
The waitforit application we use in seeding has changed ownership.
cooperaj Jan 17, 2025
d84280a
Ensure we handle modernise records in the DB when the combined format…
cooperaj Jan 17, 2025
a2685c1
Code tidy ups after rebase
cooperaj Jan 17, 2025
3a2fbad
Fix test namespaces to stop composer autoload errors
cooperaj Jan 17, 2025
d1d81aa
Reinstate the remove lpa fix from UML-3791
cooperaj Jan 17, 2025
461ed67
Remove added feature flag from behat test configuration
cooperaj Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker-compose.dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ services:
condition: service_healthy
mock-one-login:
condition: service_started
restart: true
environment:
SIRIUS_API_ENDPOINT: http://api-gateway:5000
LPA_CODES_API_ENDPOINT: http://codes-gateway:4343
Expand Down
3 changes: 2 additions & 1 deletion service-api/app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"paragonie/hidden-string": "^1.0",
"psr/clock": "^1.0",
"ramsey/uuid": "^4.0",
"spatie/php-cloneable": "^1.0.2",
"symfony/console": "^6.1",
"web-token/jwt-signature-algorithm-ecdsa": "^3.2",
"web-token/jwt-encryption-algorithm-aeskw": "^3.4.0"
Expand Down Expand Up @@ -132,7 +133,7 @@
"clear-config-cache": "php bin/clear-config-cache.php",
"dc": [
"Composer\\Config::disableProcessTimeout",
"docker-compose -f ../../docker-compose.yml -f ../../docker-compose.dependencies.yml"
"docker compose -f ../../docker-compose.yml -f ../../docker-compose.dependencies.yml -f ../../docker-compose.testing.yml -f ../../docker-compose.override.yml"
],
"dc-run": "@dc run --rm api-app",
"dc-php": "@dc-run php",
Expand Down
2,194 changes: 1,170 additions & 1,024 deletions service-api/app/composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions service-api/app/config/pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

declare(strict_types=1);

use Psr\Container\ContainerInterface;
use Laminas\Stratigility\Middleware\ErrorHandler;
use Mezzio\Application;
use Mezzio\Handler\NotFoundHandler;
use Mezzio\Helper\BodyParams\BodyParamsMiddleware;
use Mezzio\Helper\ServerUrlMiddleware;
use Mezzio\Helper\UrlHelperMiddleware;
use Mezzio\MiddlewareFactory;
use Mezzio\Helper\BodyParams\BodyParamsMiddleware;
use Mezzio\Router\Middleware\DispatchMiddleware;
use Mezzio\Router\Middleware\ImplicitHeadMiddleware;
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
use Mezzio\Router\Middleware\MethodNotAllowedMiddleware;
use Mezzio\Router\Middleware\RouteMiddleware;
use Laminas\Stratigility\Middleware\ErrorHandler;
use Psr\Container\ContainerInterface;

/**
* Setup middleware pipeline:
Expand Down
3 changes: 0 additions & 3 deletions service-api/app/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use App\Handler\UserHandler;
use App\Handler\ViewerCodeFullHandler;
use App\Handler\ViewerCodeSummaryHandler;
use App\Handler\LpasCollectionV2Handler;
use Mezzio\Application;
use Mezzio\MiddlewareFactory;
use Psr\Container\ContainerInterface;
Expand Down Expand Up @@ -65,8 +64,6 @@
$app->get('/healthcheck', HealthcheckHandler::class, 'healthcheck');

$app->get('/v1/lpas', LpasCollectionHandler::class, 'lpa.collection');

$app->get('/v2/lpas', LpasCollectionV2Handler::class, 'lpa.collection.v2');

$app->post(
'/v1/older-lpa/validate',
Expand Down
95 changes: 95 additions & 0 deletions service-api/app/docs/examples/lpa-response-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
summary: User has LPAs
value:
1c72b660-0da0-4acf-9c27-2de57c1a255b:
user-lpa-actor-token: 1c72b660-0da0-4acf-9c27-2de57c1a255b
date: 2024-11-22T15:20:16+00:00
actor:
details:
addressLine1: 81 NighOnTimeWeBuiltIt Street
addressLine2: null
addressLine3: null
country: GB
county: null
dob: 1982-07-24
email: null
firstnames: Herman
name: null
postcode: null
surname: Seakrest
systemStatus: active
town: Mahhhhhhhhhh
type: null
uId: 9ac5cb7c-fc75-40c7-8e53-059f36dbbe3d
type: donor
lpa:
applicationHasGuidance: null
applicationHasRestrictions: null
applicationType: null
attorneyActDecisions: jointly
attorneys:
- addressLine1: 81 NighOnTimeWeBuiltIt Street
addressLine2: null
addressLine3: null
country: GB
county: null
dob: '1982-07-24'
email: null
firstnames: Herman
name: null
postcode: null
surname: Seakrest
systemStatus: active
town: Mahhhhhhhhhh
type: null
uId: 9ac5cb7c-fc75-40c7-8e53-059f36dbbe3d
caseSubtype: hw
channel: online
dispatchDate: null
donor:
addressLine1: 74 Cloob Close
addressLine2: null
addressLine3: null
country: GB
county: null
dob: '1970-01-24'
email: [email protected]
firstnames: Feeg
name: null
postcode: null
surname: Bundlaaaa
systemStatus:
town: Mahhhhhhhhhh
type: null
uId: eda719db-8880-4dda-8c5d-bb9ea12c236f
hasSeveranceWarning: null
invalidDate: null
lifeSustainingTreatment: option-a
lpaDonorSignatureDate: '2024-01-10T23:00:00Z'
lpaIsCleansed: null
onlineLpaId: null
receiptDate: null
registrationDate: '2024-01-12T00:00:00Z'
rejectedDate: null
replacementAttorneys: []
status: registered
statusDate: null
trustCorporations:
- addressLine1: 103 Line 1
addressLine2: null
addressLine3: null
country: GB
county: null
dob: null
email: null
firstnames: null
name: Trust us Corp.
postcode: null
surname: null
systemStatus: active
town: Town
type: null
uId: 1d95993a-ffbb-484c-b2fe-f4cca51801da
uId: M-789Q-P4DF-4UX3
whenCanLpaBeUsed: when-capacity-lost
withdrawnDate: null
added: 2024-09-18T12:23:45+00:00
28 changes: 14 additions & 14 deletions service-api/app/features/context/Integration/LpaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
use App\Service\Lpa\AddLpa\AddLpa;
use App\Service\Lpa\FindActorInLpa\ActorMatch;
use App\Service\Lpa\GetInstructionsAndPreferencesImages;
use App\Service\Lpa\LpaManagerInterface;
use App\Service\Lpa\RemoveLpa;
use App\Service\Lpa\SiriusLpa;
use App\Service\Lpa\SiriusLpaManager;
use App\Service\Lpa\SiriusPerson;
use App\Service\ViewerCodes\ViewerCodeService;
use Aws\CommandInterface;
Expand Down Expand Up @@ -74,7 +74,7 @@ class LpaContext extends BaseIntegrationContext
private string $codesApiPactProvider;
private string $iapImagesApiPactProvider;
private RemoveLpa $deleteLpa;
private SiriusLpaManager $lpaService;
private LpaManagerInterface $lpaService;

/**
* @Given I have previously requested the addition of a paper LPA to my account
Expand Down Expand Up @@ -205,7 +205,7 @@ public function aRecordOfTheLPARequestedIsSavedToTheDatabase(): void
)
);

$lpa = $this->lpaService->getAllForUser($this->userId);
$lpa = $this->lpaService->getAllActiveForUser($this->userId);

Assert::assertArrayHasKey($this->userLpaActorToken, $lpa);
Assert::assertEquals($lpa[$this->userLpaActorToken]['user-lpa-actor-token'], $this->userLpaActorToken);
Expand Down Expand Up @@ -602,7 +602,7 @@ public function iRequestToAddAnLPAThatIHaveRequestedAnActivationKeyFor(): void

Assert::assertArrayHasKey('actor', $validatedLpa);
Assert::assertArrayHasKey('lpa', $validatedLpa);
Assert::assertEquals($validatedLpa['lpa']['uId'], $this->lpaUid);
Assert::assertEquals($validatedLpa['lpa']->getUid(), $this->lpaUid);
}

/**
Expand Down Expand Up @@ -793,7 +793,7 @@ public function iCanSeeThatMyLPAHasWithExpiryDates($noActiveCodes, $code1Expiry,
$this->lpa
);

$lpa = $this->lpaService->getAllForUser($this->userId);
$lpa = $this->lpaService->getAllActiveForUser($this->userId);

Assert::assertArrayHasKey($this->userLpaActorToken, $lpa);
Assert::assertEquals($lpa[$this->userLpaActorToken]['user-lpa-actor-token'], $this->userLpaActorToken);
Expand Down Expand Up @@ -940,7 +940,7 @@ public function iCanSeeThatNoOrganisationsHaveAccessToMyLPA(): void
$this->lpa
);

$lpa = $this->lpaService->getAllForUser($this->userId);
$lpa = $this->lpaService->getAllActiveForUser($this->userId);

Assert::assertArrayHasKey($this->userLpaActorToken, $lpa);
Assert::assertEquals($lpa[$this->userLpaActorToken]['user-lpa-actor-token'], $this->userLpaActorToken);
Expand Down Expand Up @@ -1280,8 +1280,8 @@ public function iClickToCheckMyAccessCodes(): void
Assert::assertArrayHasKey('date', $lpaData);
Assert::assertArrayHasKey('actor', $lpaData);
Assert::assertEquals($this->userLpaActorToken, $lpaData['user-lpa-actor-token']);
Assert::assertEquals($this->lpa->uId, $lpaData['lpa']['uId']);
Assert::assertEquals($this->actorLpaId, $lpaData['actor']->actor['uId']);
Assert::assertEquals($this->lpa->uId, $lpaData['lpa']->getUid());
Assert::assertEquals($this->actorLpaId, $lpaData['actor']->actor->getUid());

// Get the share codes

Expand Down Expand Up @@ -2031,7 +2031,7 @@ public function iRequestToAddAnLPAWithValidDetails(): void

Assert::assertArrayHasKey('actor', $validatedLpa);
Assert::assertArrayHasKey('lpa', $validatedLpa);
Assert::assertEquals($validatedLpa['lpa']['uId'], $this->lpaUid);
Assert::assertEquals($validatedLpa['lpa']->getUid(), $this->lpaUid);
}

/**
Expand Down Expand Up @@ -2220,7 +2220,7 @@ public function theFullLPAIsDisplayedWithTheCorrect($message)
*/
public function theLPAHasNotBeenAdded(): void
{
$lpas = $this->lpaService->getAllForUser($this->userId);
$lpas = $this->lpaService->getAllActiveForUser($this->userId);

Assert::assertEmpty($lpas);
}
Expand Down Expand Up @@ -2397,7 +2397,7 @@ public function theLPAIsRemoved(): void
*/
public function theLPAIsSuccessfullyAdded(): void
{
$now = (new DateTime())->format('Y-m-d\TH:i:s.u\Z');
$now = (new DateTime())->format('Y-m-d\TH:i:s.u\Z');
$this->userLpaActorToken = '13579';

// UserLpaActorMap::getUsersLpas
Expand Down Expand Up @@ -2463,7 +2463,7 @@ protected function prepareContext(): void

$this->apiFixtures = $this->container->get(MockHandler::class);
$this->awsFixtures = $this->container->get(AwsMockHandler::class);
$this->lpaService = $this->container->get(SiriusLpaManager::class);
$this->lpaService = $this->container->get(LpaManagerInterface::class);
$this->deleteLpa = $this->container->get(RemoveLpa::class);

$config = $this->container->get('config');
Expand Down Expand Up @@ -2513,7 +2513,7 @@ public function theStatusOfTheLPAChangedFromRegisteredToSuspended(): void
$this->lpa
);

$lpa = $this->lpaService->getAllForUser($this->userId);
$lpa = $this->lpaService->getAllActiveForUser($this->userId);

Assert::assertEmpty($lpa);
}
Expand Down Expand Up @@ -2604,7 +2604,7 @@ public function anLPAGivesAnUnexpectedError(): void
$this->lpa
);

$lpa = $this->lpaService->getAllForUser($this->userId);
$lpa = $this->lpaService->getAllActiveForUser($this->userId);

assertEquals(1, sizeof($lpa));
}
Expand Down
Loading
Loading