Replace PhonenumberConstraint with MisdPhoneNumberConstraint across entities, deprecate outdated validation logic, and remove unused methods for improved phone number validation.

This commit is contained in:
2025-09-17 13:39:09 +02:00
parent ff2c567d05
commit 4a73aaae94
11 changed files with 30 additions and 20 deletions

View File

@@ -27,7 +27,6 @@ use Chill\MainBundle\Entity\Language;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSignatureStateEnum;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepSignature;
use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
use Chill\PersonBundle\Entity\Household\Household;
use Chill\PersonBundle\Entity\Household\HouseholdMember;
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
@@ -47,6 +46,7 @@ use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\PhoneNumber;
use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as MisdPhoneNumberConstraint;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -319,7 +319,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* The person's mobile phone number.
*/
#[ORM\Column(type: 'phone_number', nullable: true)]
#[PhonenumberConstraint(type: 'mobile')]
#[MisdPhoneNumberConstraint(type: [MisdPhoneNumberConstraint::MOBILE])]
private ?PhoneNumber $mobilenumber = null;
/**
@@ -359,7 +359,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* The person's phonenumber.
*/
#[ORM\Column(type: 'phone_number', nullable: true)]
#[PhonenumberConstraint(type: 'landline')]
#[MisdPhoneNumberConstraint(type: [MisdPhoneNumberConstraint::FIXED_LINE, MisdPhoneNumberConstraint::VOIP, MisdPhoneNumberConstraint::PERSONAL_NUMBER])]
private ?PhoneNumber $phonenumber = null;
/**