mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-22 21:22:48 +00:00
Add unique constraint for PersonIdentifier
, implement UniqueIdentifierConstraint
with validation logic, and include supporting tests
- Introduce `UniqueIdentifierConstraint` and its validator for ensuring identifier uniqueness. - Add a database-level unique constraint on `PersonIdentifier` (`definition_id`, `value`). - Implement repository method to fetch identifiers by definition and value. - Include integration and unit tests for validation and repository functionality. - Update `Person` entity with `Assert\Valid` annotation for `identifiers`.
This commit is contained in:
@@ -275,6 +275,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonIdentifier::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[RequiredIdentifierConstraint]
|
||||
#[Assert\Valid]
|
||||
private Collection $identifiers;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user