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-3460 Return LPA store LPAs via the new endpoint in the new format #2754

Merged

Conversation

allenannom
Copy link
Contributor

@allenannom allenannom commented Aug 21, 2024

Purpose

Returning LPA store LPAs via the new endpoint in the new format

Learning

The use of a new library to map incoming data store LPA array using https://github.com/EventSaucePHP/ObjectHydrator

Checklist

  • I have performed a self-review of my own code
  • I have added relevant logging with appropriate levels to my code
  • New event_codes have been documented on the wiki page
  • I have updated documentation (Confluence/GitHub wiki/tech debt doc) where relevant
  • I have added tests to prove my work
  • I have added welsh translation tags and updated translation files
  • I have run an accessibility tool on any pages I have made changes to and fixed any issues found
  • I have notified the Interaction Designer of any content changes so that appropriate screenshots/flow diagram changes can be made
  • The product team have tested these changes

@github-actions github-actions bot added dependencies Pull requests that update a dependency file php Pull requests that update Php code service-api labels Aug 21, 2024
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.45%. Comparing base (f00760a) to head (3dfdc32).
Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2754      +/-   ##
============================================
+ Coverage     91.25%   91.45%   +0.20%     
- Complexity     1504     1537      +33     
============================================
  Files           309      326      +17     
  Lines          6393     6543     +150     
============================================
+ Hits           5834     5984     +150     
  Misses          542      542              
  Partials         17       17              
Flag Coverage Δ
use-an-lpa-admin 79.26% <ø> (ø)
use-an-lpa-api 97.52% <100.00%> (+0.15%) ⬆️
use-an-lpa-front 89.54% <ø> (ø)
Files with missing lines Coverage Δ
...app/src/App/src/Entity/Casters/CastSingleDonor.php 100.00% <100.00%> (ø)
...p/src/App/src/Entity/Casters/CastToCaseSubtype.php 100.00% <100.00%> (ø)
...c/Entity/Casters/CastToLifeSustainingTreatment.php 100.00% <100.00%> (ø)
...p/src/Entity/Casters/CastToWhenTheLpaCanBeUsed.php 100.00% <100.00%> (ø)
...Entity/Casters/ExtractAddressLine1FromLpaStore.php 100.00% <100.00%> (ø)
.../src/Entity/Casters/ExtractCountryFromLpaStore.php 100.00% <100.00%> (ø)
...App/src/Entity/Casters/ExtractTownFromLpaStore.php 100.00% <100.00%> (ø)
service-api/app/src/App/src/Entity/Lpa.php 100.00% <100.00%> (ø)
...e-api/app/src/App/src/Entity/LpaStore/LpaStore.php 100.00% <100.00%> (ø)
...p/src/App/src/Entity/LpaStore/LpaStoreAttorney.php 100.00% <100.00%> (ø)
... and 5 more

@allenannom allenannom marked this pull request as ready for review September 2, 2024 09:40
@allenannom allenannom requested a review from a team as a code owner September 2, 2024 09:40
Copy link
Contributor

@cooperaj cooperaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I think the dates need a change.

*/
public function __invoke(array $lpa)
{
$defaultSerializerRepository = new DefaultSerializerRepository([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using interfaces for the dates might make this bit redundant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the DateTimeInterface setup is needed now?

#[Test]
public function can_serialise_datastore_lpa_to_modernise_format(): void
{
$lpa = json_decode(file_get_contents(__DIR__ . '../../../../test/fixtures/test_lpa.json'), true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Sirius LPA I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yeah it is.. my bad

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to just link directly to one from the mock. If tests breaks because someone changes those in development thats a good thing.

@@ -4,14 +4,34 @@

namespace AppTest\Service\Lpa;

use App\Entity\Casters\{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these imports used anymore?

@cooperaj
Copy link
Contributor

cooperaj commented Sep 4, 2024

Just realised the Person entity appears to be missing the uid field?

…-endpoint-in-new-format

# Conflicts:
#	service-api/app/test/AppTest/Service/Lpa/LpaServiceTest.php
class Person
{
public function __construct(
public readonly ?string $uId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LPA seems to have properties in alphabetical order but this one (and it's extensions) don't?

Copy link
Contributor

@cooperaj cooperaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

@allenannom allenannom merged commit e8f2072 into main Sep 11, 2024
34 checks passed
@allenannom allenannom deleted the UML-3460-return-lpa-store-via-new-endpoint-in-new-format branch September 11, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file php Pull requests that update Php code service-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants