Replace value with canonical in PersonIdentifier unique constraint, repository logic, and tests

- Update unique constraint on `PersonIdentifier` to use `canonical` instead of `value`.
- Refactor repository method `findByDefinitionAndValue` to `findByDefinitionAndCanonical`, updating logic accordingly.
- Adjust validation logic in `UniqueIdentifierConstraintValidator` to align with the new canonical-based approach.
- Modify related integration and unit tests to support the changes.
- Inject `PersonIdentifierManagerInterface` into the repository to handle canonical value generation.
This commit is contained in:
2025-09-24 12:39:37 +02:00
parent 0fd76d3fa8
commit 6ea9af588b
7 changed files with 28 additions and 17 deletions

View File

@@ -19,9 +19,11 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class StringIdentifier implements PersonIdentifierEngineInterface
{
public const NAME = 'chill-person-bundle.string-identifier';
public static function getName(): string
{
return 'chill-person-bundle.string-identifier';
return self::NAME;
}
public function canonicalizeValue(array $value, PersonIdentifierDefinition $definition): ?string