-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…2903) * update types to display viewer journey * update casters and templates for remaining combined lpa format * add code-sniffer-pre-commit * fix brackets * include pre-commit origins * feature flag by separate templates * drop unused template * cover new enums and entities * drop sniffer hook, share mock data, cover feature enabled injection * cover ParseLpaData * cover serialisation * return HowAttorneysAct and WhenCanLpaBeUsed from API, fix templates, fix PDF download * format * add missing strict_types * more test fixes * test fixes * cover getters * revert api changes (to be extracted to new branch) * more api revert * ensure LpaType is accessible, fix addresses, make mock combined data dynamic * reinstate mocked values * bump cov * revert api * fix sniffs * fix sniffs * Remove Serialisation code and revert field name change. * Fix unit tests and remove tests we don't need * Remove JsonSerializable definitions * Further test cleanup * Use correct 'uid' field name --------- Co-authored-by: Allen Annom <[email protected]> Co-authored-by: Adam Cooper <[email protected]>
- Loading branch information
1 parent
1bc3a1d
commit 4f38b73
Showing
57 changed files
with
2,057 additions
and
1,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
service-front/app/src/Common/src/Entity/Casters/CastToHowAttorneysMakeDecisions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Common\Entity\Casters; | ||
|
||
use Attribute; | ||
use Common\Enum\HowAttorneysMakeDecisions; | ||
use Common\Enum\WhenTheLpaCanBeUsed; | ||
use EventSauce\ObjectHydrator\ObjectMapper; | ||
use EventSauce\ObjectHydrator\PropertyCaster; | ||
|
||
#[Attribute(Attribute::TARGET_PARAMETER)] | ||
class CastToHowAttorneysMakeDecisions implements PropertyCaster | ||
{ | ||
public function cast(mixed $value, ObjectMapper $hydrator): ?string | ||
{ | ||
return HowAttorneysMakeDecisions::from($value)->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
service-front/app/src/Common/src/Entity/Casters/ExtractPostcodeFromLpaStore.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Common\Entity\Casters; | ||
|
||
use Attribute; | ||
use EventSauce\ObjectHydrator\ObjectMapper; | ||
use EventSauce\ObjectHydrator\PropertyCaster; | ||
|
||
#[Attribute(Attribute::TARGET_PARAMETER)] | ||
class ExtractPostcodeFromLpaStore implements PropertyCaster | ||
{ | ||
public function cast(mixed $value, ObjectMapper $hydrator): ?string | ||
{ | ||
if (is_array($value) && isset($value['postcode'])) { | ||
return $value['postcode']; | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.