Add personId serialization to PersonJsonNormalizer

- Inject `PersonIdRenderingInterface` into `PersonJsonNormalizer` for generating `personId`.
- Update `PersonJsonNormalizer` to include `personId` in serialized output.
- Extend TypeScript definitions to support `personId` property.
- Enhance unit tests to cover `personId` serialization.
This commit is contained in:
2025-09-25 15:00:11 +02:00
parent d42a1296c4
commit bfbde078b7
3 changed files with 14 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ class PersonJsonNormalizer implements NormalizerAwareInterface, NormalizerInterf
private readonly CenterResolverManagerInterface $centerResolverManager,
private readonly ResidentialAddressRepository $residentialAddressRepository,
private readonly PhoneNumberHelperInterface $phoneNumberHelper,
private readonly \Chill\PersonBundle\PersonIdentifier\Rendering\PersonIdRenderingInterface $personIdRendering,
) {}
/**
@@ -67,6 +68,7 @@ class PersonJsonNormalizer implements NormalizerAwareInterface, NormalizerInterf
'email' => $person->getEmail(),
'gender' => $this->normalizer->normalize($person->getGender(), $format, $context),
'civility' => $this->normalizer->normalize($person->getCivility(), $format, $context),
'personId' => $this->personIdRendering->renderPersonId($person),
];
if (\in_array('minimal', $groups, true) && 1 === \count($groups)) {